(empty log message)
@@ -9,7 +9,6 @@ | ||
9 | 9 | import java.util.concurrent.locks.*; |
10 | 10 | import java.util.concurrent.ConcurrentHashMap; |
11 | 11 | |
12 | -import java.util.concurrent.ConcurrentLinkedQueue; | |
13 | 12 | import java.util.zip.*; |
14 | 13 | |
15 | 14 | import okuyama.imdst.util.*; |
@@ -1383,10 +1383,16 @@ | ||
1383 | 1383 | if (!blocking) { |
1384 | 1384 | |
1385 | 1385 | int counter = 0; |
1386 | - | |
1387 | - | |
1386 | +/* | |
1387 | +String testList = getTargetTagIndexList(tag); | |
1388 | +System.out.println("testList[" + testList); | |
1389 | +String[] testIndexs = testList.split(KeyMapManager.tagKeySep); | |
1390 | +System.out.println("[0]=" + getTargetIndexTagPair(tag, new Integer(testIndexs[0]).intValue())); | |
1391 | +System.out.println("[1]=" + getTargetIndexTagPair(tag, new Integer(testIndexs[1]).intValue())); | |
1392 | +*/ | |
1388 | 1393 | // Tagのキー値を連結 |
1389 | 1394 | for (int idx = 0; idx < ImdstDefine.tagRegisterParallelBucket; idx=idx+ImdstDefine.tagBucketMaxLink) { |
1395 | + | |
1390 | 1396 | keyStrs = null; |
1391 | 1397 | setTimeSplitWork = null; |
1392 | 1398 | isMatch = false; |
@@ -1401,34 +1407,34 @@ | ||
1401 | 1407 | String tagCnv = KeyMapManager.tagStartStr + tag + "_" + counter + KeyMapManager.tagEndStr; |
1402 | 1408 | |
1403 | 1409 | if (this.containsKeyPair(tagCnv)) { |
1404 | - | |
1410 | + | |
1405 | 1411 | tmpStr = (String)this.getKeyPair(tagCnv); |
1406 | 1412 | |
1407 | 1413 | if (tmpStr != null && !((String[])tmpStr.split("!"))[0].equals("*")) { |
1408 | - | |
1414 | + | |
1409 | 1415 | isMatch = true; |
1410 | 1416 | tmpBuf.append(tmpSep); |
1411 | - | |
1417 | + | |
1412 | 1418 | setTimeSplitWork = tmpStr.split(ImdstDefine.setTimeParamSep); |
1413 | - | |
1419 | + | |
1414 | 1420 | if (setTimeSplitWork.length > 1) lastSetTime = setTimeSplitWork[1]; |
1415 | - | |
1421 | + | |
1416 | 1422 | tmpBuf.append(setTimeSplitWork[0]); |
1417 | 1423 | tmpSep = KeyMapManager.tagKeySep; |
1418 | 1424 | |
1419 | 1425 | } else if (tmpStr == null || ((String[])tmpStr.split("!"))[0].equals("*")){ |
1420 | - | |
1426 | + | |
1421 | 1427 | if (!isMatch) { |
1422 | - | |
1428 | + | |
1423 | 1429 | keyStrs = null; |
1424 | 1430 | } else { |
1425 | - | |
1431 | + | |
1426 | 1432 | keyStrs = tmpBuf.toString(); |
1427 | 1433 | } |
1428 | 1434 | break; |
1429 | 1435 | } |
1430 | 1436 | } else { |
1431 | - | |
1437 | + | |
1432 | 1438 | if (!isMatch) { |
1433 | 1439 | keyStrs = null; |
1434 | 1440 | } else { |
@@ -1438,9 +1444,8 @@ | ||
1438 | 1444 | } |
1439 | 1445 | counter++; |
1440 | 1446 | } |
1441 | - | |
1447 | + | |
1442 | 1448 | if (keyStrs != null) { |
1443 | - | |
1444 | 1449 | ret.append(counterSep); |
1445 | 1450 | ret.append(keyStrs); |
1446 | 1451 | counterSep = KeyMapManager.tagKeySep; |
@@ -1447,7 +1452,7 @@ | ||
1447 | 1452 | } |
1448 | 1453 | } |
1449 | 1454 | } |
1450 | - | |
1455 | + | |
1451 | 1456 | if (ret.toString().equals("")) { |
1452 | 1457 | keyStrs = null; |
1453 | 1458 | } else { |
@@ -1454,10 +1459,163 @@ | ||
1454 | 1459 | ret.append(ImdstDefine.setTimeParamSep).append(lastSetTime); |
1455 | 1460 | keyStrs = ret.toString(); |
1456 | 1461 | } |
1462 | + | |
1457 | 1463 | return keyStrs; |
1458 | 1464 | } |
1459 | 1465 | |
1460 | 1466 | |
1467 | + /** | |
1468 | + * 対象のTagのデータが存在する位置をKeyMapManager.tagKeySepで連結した文字列を返す<.br> | |
1469 | + * 本メソッドで取得したIndexをgetTargetIndexTagPairに渡すことで指定位置のTagとKeyのペアを取得可能.<br> | |
1470 | + * | |
1471 | + * @param tag タグ | |
1472 | + * @return 指定したTag値が分割保存されているIndexの中で実際に値が存在するIndexのKeyMapManager.tagKeySep区切り文字列。Tagが登録されていない場合はnullが返る | |
1473 | + */ | |
1474 | + public String getTargetTagIndexList(String tag) { | |
1475 | + String keyIndexList = ""; | |
1476 | + String tmpStr = null; | |
1477 | + String tmpSep = ""; | |
1478 | + StringBuilder retBuf = new StringBuilder(1024); | |
1479 | + | |
1480 | + if (!blocking) { | |
1481 | + | |
1482 | + int counter = 0; | |
1483 | + tmpSep = ""; | |
1484 | + | |
1485 | + // Tagのキー値を連結 | |
1486 | + for (int idx = 0; idx < ImdstDefine.tagRegisterParallelBucket; idx=idx+ImdstDefine.tagBucketMaxLink) { | |
1487 | +System.out.println(idx); | |
1488 | + | |
1489 | + counter = idx; | |
1490 | + | |
1491 | + while(true) { | |
1492 | + | |
1493 | + String tagCnv = KeyMapManager.tagStartStr + tag + "_" + counter + KeyMapManager.tagEndStr; | |
1494 | + | |
1495 | + if (this.containsKeyPair(tagCnv)) { | |
1496 | + | |
1497 | + tmpStr = (String)this.getKeyPair(tagCnv); | |
1498 | + | |
1499 | + if (tmpStr != null && !((String[])tmpStr.split("!"))[0].equals("*")) { | |
1500 | + | |
1501 | + | |
1502 | + retBuf.append(tmpSep); | |
1503 | + retBuf.append(counter); | |
1504 | + tmpSep = KeyMapManager.tagKeySep; | |
1505 | + break; | |
1506 | + } else if (tmpStr == null || ((String[])tmpStr.split("!"))[0].equals("*")){ | |
1507 | + | |
1508 | + break; | |
1509 | + } | |
1510 | + } else { | |
1511 | + | |
1512 | + break; | |
1513 | + } | |
1514 | + counter++; | |
1515 | + } | |
1516 | + } | |
1517 | + } | |
1518 | + | |
1519 | + | |
1520 | + keyIndexList = retBuf.toString(); | |
1521 | + if (keyIndexList == null || keyIndexList.equals("")) { | |
1522 | + keyIndexList = null; | |
1523 | + } | |
1524 | +System.out.println(keyIndexList); | |
1525 | + return keyIndexList; | |
1526 | + } | |
1527 | + | |
1528 | + | |
1529 | + public String getTargetIndexTagPair(String tag, int index) { | |
1530 | + String keyStrs = ""; | |
1531 | + String[] setTimeSplitWork = null; | |
1532 | + | |
1533 | + boolean isMatch = false; | |
1534 | + StringBuilder tmpBuf = new StringBuilder(ImdstDefine.stringBufferLarge_2Size); | |
1535 | + String tmpStr = null; | |
1536 | + String tmpSep = ""; | |
1537 | + String lastSetTime = ""; | |
1538 | + String counterSep = ""; | |
1539 | + StringBuilder ret = new StringBuilder(); | |
1540 | + | |
1541 | + if (!blocking) { | |
1542 | + | |
1543 | + int counter = 0; | |
1544 | + | |
1545 | + | |
1546 | + // Tagのキー値を連結 | |
1547 | + | |
1548 | +//System.out.println(index); | |
1549 | + keyStrs = null; | |
1550 | + setTimeSplitWork = null; | |
1551 | + isMatch = false; | |
1552 | + tmpBuf = new StringBuilder(ImdstDefine.stringBufferLarge_2Size); | |
1553 | + tmpStr = null; | |
1554 | + tmpSep = ""; | |
1555 | + | |
1556 | + | |
1557 | + counter = index; | |
1558 | + while(true) { | |
1559 | + | |
1560 | + String tagCnv = KeyMapManager.tagStartStr + tag + "_" + counter + KeyMapManager.tagEndStr; | |
1561 | + | |
1562 | + if (this.containsKeyPair(tagCnv)) { | |
1563 | + | |
1564 | + tmpStr = (String)this.getKeyPair(tagCnv); | |
1565 | + | |
1566 | + if (tmpStr != null && !((String[])tmpStr.split("!"))[0].equals("*")) { | |
1567 | + | |
1568 | + isMatch = true; | |
1569 | + tmpBuf.append(tmpSep); | |
1570 | + | |
1571 | + setTimeSplitWork = tmpStr.split(ImdstDefine.setTimeParamSep); | |
1572 | + | |
1573 | + if (setTimeSplitWork.length > 1) lastSetTime = setTimeSplitWork[1]; | |
1574 | + | |
1575 | + tmpBuf.append(setTimeSplitWork[0]); | |
1576 | + tmpSep = KeyMapManager.tagKeySep; | |
1577 | + | |
1578 | + } else if (tmpStr == null || ((String[])tmpStr.split("!"))[0].equals("*")){ | |
1579 | + | |
1580 | + if (!isMatch) { | |
1581 | + | |
1582 | + keyStrs = null; | |
1583 | + } else { | |
1584 | + | |
1585 | + keyStrs = tmpBuf.toString(); | |
1586 | + } | |
1587 | + break; | |
1588 | + } | |
1589 | + } else { | |
1590 | + | |
1591 | + if (!isMatch) { | |
1592 | + keyStrs = null; | |
1593 | + } else { | |
1594 | + keyStrs = tmpBuf.toString(); | |
1595 | + } | |
1596 | + break; | |
1597 | + } | |
1598 | + counter++; | |
1599 | + } | |
1600 | + | |
1601 | + if (keyStrs != null) { | |
1602 | +//System.out.println(keyStrs); | |
1603 | + ret.append(counterSep); | |
1604 | + ret.append(keyStrs); | |
1605 | + counterSep = KeyMapManager.tagKeySep; | |
1606 | + } | |
1607 | + } | |
1608 | + | |
1609 | + if (ret.toString().equals("")) { | |
1610 | + keyStrs = null; | |
1611 | + } else { | |
1612 | + ret.append(ImdstDefine.setTimeParamSep).append(lastSetTime); | |
1613 | + keyStrs = ret.toString(); | |
1614 | + } | |
1615 | +//System.out.println(keyStrs); | |
1616 | + return keyStrs; | |
1617 | + } | |
1618 | + | |
1461 | 1619 | // Tagを指定することでTagを消す |
1462 | 1620 | public String removeTagRelation(String tag, String transactionCode) throws BatchException { |
1463 | 1621 | String keyStrs = ""; |
@@ -21,7 +21,7 @@ | ||
21 | 21 | * -nct ImdstDefine.nodeConnectionTimeout /DataNodeへのSocketコネクションreadのタイムアウト閾値(ミリ秒) |
22 | 22 | * -mmgrs ImdstDefine.maxMultiGetRequestSize /getMultiValueの際に一度にDataNodeに問い合わせるRequestKeyの数 |
23 | 23 | * -sidc ImdstDefine.searchIndexDistributedCount /検索Indexを並列に作成する場合の並列数 |
24 | - * -gaetu ImdstDefine.getAndExpireTimeUpdate /データの有効期限をGetメソッドで更新するかの指定(未実装) | |
24 | + * -gaetu ImdstDefine.getAndExpireTimeUpdate /データの有効期限をGetメソッドで更新するかの指定 | |
25 | 25 | * -fbmnk ImdstDefine.fileBaseMapNumberOfOneFileKey /FileBaseDataMapで1KeyファイルにどれだけのKey値を保存するかの指定 |
26 | 26 | * -tlft ImdstDefine.transactionLogFsyncType /WALログのファイルシステムへのfsync係数(0=OSでの自動sync制御、1=fsync回数低、2=fsync回数中、3=fsync回数高、4=常にfsync |
27 | 27 | * -vidf ImdstDefine.vacuumInvalidDataFlg /有効期限切れのデータのクリーニングを行うかどうかの設定 true=行う false=行わない |