@@ -76,7 +76,7 @@ public synchronized ISession buildSession(boolean forceEnable) {
7676 flush ();
7777 }
7878 // debug begin
79- debug ();
79+ // debug();
8080 // debug end
8181 advance ();
8282 ++activeSession ;
@@ -213,9 +213,9 @@ private boolean shouldBeRefreshed() {
213213
214214 private void refresh () {
215215 // debug begin
216- List <String > debugBlockHashs = new ArrayList <>();
217- Map <String , String > debugDumpDataMap = new HashMap <>();
218- Multimap <String , byte []> values = ArrayListMultimap .create ();
216+ // List<String> debugBlockHashs = new ArrayList<>();
217+ // Map<String, String> debugDumpDataMap = new HashMap<>();
218+ // Multimap<String, byte[]> values = ArrayListMultimap.create();
219219 // debug end
220220
221221 for (RevokingDBWithCachingNewValue db : dbs ) {
@@ -232,31 +232,31 @@ private void refresh() {
232232 Snapshot next = solidity .getRoot ().getNext ();
233233 while (next != solidity .getNext ()) {
234234 // debug begin
235- String dbName = db .getDbName ();
236- SnapshotImpl snapshot = (SnapshotImpl ) next ;
237- DB <Key , Value > keyValueDB = snapshot .getDb ();
238- for (Map .Entry <Key , Value > e : keyValueDB ) {
239- Key k = e .getKey ();
240- Value v = e .getValue ();
241- debugDumpDataMap .put (dbName + ":" + ByteUtil .toHexString (k .getBytes ()),
242- dbName + ":" + ByteUtil .toHexString (k .getBytes ()) + ":"
243- + (e .getValue ().getBytes () == null ? null : Sha256Hash .of (v .getBytes ())));
244- if ("block" .equals (dbName )) {
245- debugBlockHashs .add (Longs .fromByteArray (k .getBytes ()) + ":" + ByteUtil .toHexString (k .getBytes ()));
246- }
247- if ("account" .equals (dbName ) && v .getBytes () != null ) {
248- values .put (ByteUtil .toHexString (k .getBytes ()), v .getBytes ());
249- }
250- }
235+ // String dbName = db.getDbName();
236+ // SnapshotImpl snapshot = (SnapshotImpl) next;
237+ // DB<Key, Value> keyValueDB = snapshot.getDb();
238+ // for (Map.Entry<Key, Value> e : keyValueDB) {
239+ // Key k = e.getKey();
240+ // Value v = e.getValue();
241+ // debugDumpDataMap.put(dbName + ":" + ByteUtil.toHexString(k.getBytes()),
242+ // dbName + ":" + ByteUtil.toHexString(k.getBytes()) + ":"
243+ // + (e.getValue().getBytes() == null ? null : Sha256Hash.of(v.getBytes())));
244+ // if ("block".equals(dbName)) {
245+ // debugBlockHashs.add(Longs.fromByteArray(k.getBytes()) + ":" + ByteUtil.toHexString(k.getBytes()));
246+ // }
247+ // if ("account".equals(dbName) && v.getBytes() != null) {
248+ // values.put(ByteUtil.toHexString(k.getBytes()), v.getBytes());
249+ // }
250+ // }
251251 // debug end
252252 snapshots .add (next );
253253 next = next .getNext ();
254254 }
255255
256256 // debug begin
257- if ("block" .equals (db .getDbName ())) {
258- logger .info ("**** debug previous:{}, next:{}, snapshots:{}" ,snapshots .get (0 ).getPrevious (), snapshots .get (snapshots .size () - 1 ).getNext (), snapshots );
259- }
257+ // if ("block".equals(db.getDbName())) {
258+ // logger.info("**** debug previous:{}, next:{}, snapshots:{}",snapshots.get(0).getPrevious(), snapshots.get(snapshots.size() - 1).getNext(), snapshots);
259+ // }
260260 // debug end
261261
262262 ((SnapshotRoot ) solidity .getRoot ()).merge (snapshots );
@@ -270,8 +270,8 @@ private void refresh() {
270270 }
271271 }
272272 // debug begin
273- List <String > debugDumpDatas = debugDumpDataMap .entrySet ().stream ().map (Entry ::getValue ).sorted (String ::compareTo ).collect (Collectors .toList ());
274- logger .info ("***debug refresh: blocks={}, datahash:{}, accounts:{}\n " , debugBlockHashs , Sha256Hash .of (debugDumpDatas .toString ().getBytes ()), printAccount (null ));
273+ // List<String> debugDumpDatas = debugDumpDataMap.entrySet().stream().map(Entry::getValue).sorted(String::compareTo).collect(Collectors.toList());
274+ // logger.info("***debug refresh: blocks={}, datahash:{}, accounts:{}\n", debugBlockHashs, Sha256Hash.of(debugDumpDatas.toString().getBytes()), printAccount(null));
275275 // debug end
276276 }
277277
@@ -291,9 +291,9 @@ public void flush() {
291291 private void createCheckPoint () {
292292 Map <WrappedByteArray , WrappedByteArray > batch = new HashMap <>();
293293 // debug begin
294- List <String > debugBlockHashs = new ArrayList <>();
295- Map <String , String > debugDumpDataMap = new HashMap <>();
296- Multimap <String , byte []> values = ArrayListMultimap .create ();
294+ // List<String> debugBlockHashs = new ArrayList<>();
295+ // Map<String, String> debugDumpDataMap = new HashMap<>();
296+ // Multimap<String, byte[]> values = ArrayListMultimap.create();
297297 // debug end
298298 for (RevokingDBWithCachingNewValue db : dbs ) {
299299 Snapshot head = db .getHead ();
@@ -317,23 +317,23 @@ private void createCheckPoint() {
317317 batch .put (WrappedByteArray .of (Bytes .concat (simpleEncode (dbName ), k .getBytes ())),
318318 WrappedByteArray .of (v .encode ()));
319319 // debug begin
320- debugDumpDataMap .put (dbName + ":" + ByteUtil .toHexString (k .getBytes ()),
321- dbName + ":" + ByteUtil .toHexString (k .getBytes ()) + ":" + (v .getBytes () == null ? null : Sha256Hash .of (v .getBytes ())));
322- if ("block" .equals (dbName )) {
323- debugBlockHashs .add (Longs .fromByteArray (k .getBytes ()) + ":" + ByteUtil .toHexString (k .getBytes ()));
324- }
325- if ("account" .equals (dbName ) && v .getBytes () != null ) {
326- values .put (ByteUtil .toHexString (k .getBytes ()), v .getBytes ());
327- }
320+ // debugDumpDataMap.put(dbName + ":" + ByteUtil.toHexString(k.getBytes()),
321+ // dbName + ":" + ByteUtil.toHexString(k.getBytes()) + ":" + (v.getBytes() == null ? null : Sha256Hash.of(v.getBytes())));
322+ // if ("block".equals(dbName)) {
323+ // debugBlockHashs.add(Longs.fromByteArray(k.getBytes()) + ":" + ByteUtil.toHexString(k.getBytes()));
324+ // }
325+ // if ("account".equals(dbName) && v.getBytes() != null) {
326+ // values.put(ByteUtil.toHexString(k.getBytes()), v.getBytes());
327+ // }
328328 // debug end
329329 }
330330 next = next .getNext ();
331331 }
332332 }
333333
334334 // debug begin
335- List <String > debugDumpDatas = debugDumpDataMap .entrySet ().stream ().map (Entry ::getValue ).sorted (String ::compareTo ).collect (Collectors .toList ());
336- logger .info ("***debug checkpoint: blocks={}, datahash:{}, accounts:{}\n " , debugBlockHashs , Sha256Hash .of (debugDumpDatas .toString ().getBytes ()), printAccount (null ));
335+ // List<String> debugDumpDatas = debugDumpDataMap.entrySet().stream().map(Entry::getValue).sorted(String::compareTo).collect(Collectors.toList());
336+ // logger.info("***debug checkpoint: blocks={}, datahash:{}, accounts:{}\n", debugBlockHashs, Sha256Hash.of(debugDumpDatas.toString().getBytes()), printAccount(null));
337337 // debug end
338338 LevelDbDataSourceImpl levelDbDataSource =
339339 new LevelDbDataSourceImpl (Args .getInstance ().getOutputDirectoryByDbName ("tmp" ), "tmp" );
@@ -355,9 +355,9 @@ private void deleteCheckPoint() {
355355 @ Override
356356 public void check () {
357357 // debug begin
358- List <String > debugBlockHashs = new ArrayList <>();
359- List <String > debugDumpDatas = new ArrayList <>();
360- Multimap <String , byte []> values = ArrayListMultimap .create ();
358+ // List<String> debugBlockHashs = new ArrayList<>();
359+ // List<String> debugDumpDatas = new ArrayList<>();
360+ // Multimap<String, byte[]> values = ArrayListMultimap.create();
361361 // debug end
362362
363363 for (RevokingDBWithCachingNewValue db : dbs ) {
@@ -388,13 +388,13 @@ public void check() {
388388 }
389389
390390 // debug begin
391- debugDumpDatas .add (db + ":" + ByteUtil .toHexString (realKey ) + ":" + (realValue == null ? null : Sha256Hash .of (realValue )));
392- if ("block" .equals (db )) {
393- debugBlockHashs .add (Longs .fromByteArray (realKey ) + ":" + ByteUtil .toHexString (realKey ));
394- }
395- if ("account" .equals (db ) && realValue != null ) {
396- values .put (ByteUtil .toHexString (realKey ), realValue );
397- }
391+ // debugDumpDatas.add(db + ":" + ByteUtil.toHexString(realKey) + ":" + (realValue == null ? null : Sha256Hash.of(realValue)));
392+ // if ("block".equals(db)) {
393+ // debugBlockHashs.add(Longs.fromByteArray(realKey) + ":" + ByteUtil.toHexString(realKey));
394+ // }
395+ // if ("account".equals(db) && realValue != null) {
396+ // values.put(ByteUtil.toHexString(realKey), realValue);
397+ // }
398398 // debug end
399399 }
400400
@@ -403,8 +403,8 @@ public void check() {
403403 }
404404
405405 // debug begin
406- debugDumpDatas .sort (String ::compareTo );
407- logger .info ("***debug check: blocks={}, datahash:{}, accounts:{}\n " , debugBlockHashs , Sha256Hash .of (debugDumpDatas .toString ().getBytes ()), printAccount (null ));
406+ // debugDumpDatas.sort(String::compareTo);
407+ // logger.info("***debug check: blocks={}, datahash:{}, accounts:{}\n", debugBlockHashs, Sha256Hash.of(debugDumpDatas.toString().getBytes()), printAccount(null));
408408 // debug end
409409
410410 levelDbDataSource .closeDB ();
0 commit comments