• R/O
  • SSH
  • HTTPS

okuyama: 提交


Commit MetaInfo

修訂780 (tree)
時間2011-10-04 01:16:39
作者okuyamaoo

Log Message

(empty log message)

Change Summary

差異

--- trunk/src/okuyama/imdst/util/serializemap/SerializeMap.java (revision 779)
+++ trunk/src/okuyama/imdst/util/serializemap/SerializeMap.java (revision 780)
@@ -9,7 +9,6 @@
99 import java.util.concurrent.locks.*;
1010 import java.util.concurrent.ConcurrentHashMap;
1111
12-import java.util.concurrent.ConcurrentLinkedQueue;
1312 import java.util.zip.*;
1413
1514 import okuyama.imdst.util.*;
--- trunk/src/okuyama/imdst/util/KeyMapManager.java (revision 779)
+++ trunk/src/okuyama/imdst/util/KeyMapManager.java (revision 780)
@@ -1383,10 +1383,16 @@
13831383 if (!blocking) {
13841384
13851385 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+*/
13881393 // Tagのキー値を連結
13891394 for (int idx = 0; idx < ImdstDefine.tagRegisterParallelBucket; idx=idx+ImdstDefine.tagBucketMaxLink) {
1395+
13901396 keyStrs = null;
13911397 setTimeSplitWork = null;
13921398 isMatch = false;
@@ -1401,34 +1407,34 @@
14011407 String tagCnv = KeyMapManager.tagStartStr + tag + "_" + counter + KeyMapManager.tagEndStr;
14021408
14031409 if (this.containsKeyPair(tagCnv)) {
1404-
1410+
14051411 tmpStr = (String)this.getKeyPair(tagCnv);
14061412
14071413 if (tmpStr != null && !((String[])tmpStr.split("!"))[0].equals("*")) {
1408-
1414+
14091415 isMatch = true;
14101416 tmpBuf.append(tmpSep);
1411-
1417+
14121418 setTimeSplitWork = tmpStr.split(ImdstDefine.setTimeParamSep);
1413-
1419+
14141420 if (setTimeSplitWork.length > 1) lastSetTime = setTimeSplitWork[1];
1415-
1421+
14161422 tmpBuf.append(setTimeSplitWork[0]);
14171423 tmpSep = KeyMapManager.tagKeySep;
14181424
14191425 } else if (tmpStr == null || ((String[])tmpStr.split("!"))[0].equals("*")){
1420-
1426+
14211427 if (!isMatch) {
1422-
1428+
14231429 keyStrs = null;
14241430 } else {
1425-
1431+
14261432 keyStrs = tmpBuf.toString();
14271433 }
14281434 break;
14291435 }
14301436 } else {
1431-
1437+
14321438 if (!isMatch) {
14331439 keyStrs = null;
14341440 } else {
@@ -1438,9 +1444,8 @@
14381444 }
14391445 counter++;
14401446 }
1441-
1447+
14421448 if (keyStrs != null) {
1443-
14441449 ret.append(counterSep);
14451450 ret.append(keyStrs);
14461451 counterSep = KeyMapManager.tagKeySep;
@@ -1447,7 +1452,7 @@
14471452 }
14481453 }
14491454 }
1450-
1455+
14511456 if (ret.toString().equals("")) {
14521457 keyStrs = null;
14531458 } else {
@@ -1454,10 +1459,163 @@
14541459 ret.append(ImdstDefine.setTimeParamSep).append(lastSetTime);
14551460 keyStrs = ret.toString();
14561461 }
1462+
14571463 return keyStrs;
14581464 }
14591465
14601466
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+
14611619 // Tagを指定することでTagを消す
14621620 public String removeTagRelation(String tag, String transactionCode) throws BatchException {
14631621 String keyStrs = "";
--- trunk/src/okuyama/imdst/process/ServerPreprocess.java (revision 779)
+++ trunk/src/okuyama/imdst/process/ServerPreprocess.java (revision 780)
@@ -21,7 +21,7 @@
2121 * -nct ImdstDefine.nodeConnectionTimeout /DataNodeへのSocketコネクションreadのタイムアウト閾値(ミリ秒)
2222 * -mmgrs ImdstDefine.maxMultiGetRequestSize /getMultiValueの際に一度にDataNodeに問い合わせるRequestKeyの数
2323 * -sidc ImdstDefine.searchIndexDistributedCount /検索Indexを並列に作成する場合の並列数
24- * -gaetu ImdstDefine.getAndExpireTimeUpdate /データの有効期限をGetメソッドで更新するかの指定(未実装)
24+ * -gaetu ImdstDefine.getAndExpireTimeUpdate /データの有効期限をGetメソッドで更新するかの指定
2525 * -fbmnk ImdstDefine.fileBaseMapNumberOfOneFileKey /FileBaseDataMapで1KeyファイルにどれだけのKey値を保存するかの指定
2626 * -tlft ImdstDefine.transactionLogFsyncType /WALログのファイルシステムへのfsync係数(0=OSでの自動sync制御、1=fsync回数低、2=fsync回数中、3=fsync回数高、4=常にfsync
2727 * -vidf ImdstDefine.vacuumInvalidDataFlg /有効期限切れのデータのクリーニングを行うかどうかの設定 true=行う false=行わない
Show on old repository browser