@@ -362,17 +362,6 @@ public boolean commitSecond() {
362
362
param .setPartId (newPartId );
363
363
param .setTableId (tableId );
364
364
}
365
- //String key = Base64.getEncoder().encodeToString(keyValue.getKey());
366
- //if (!caches.containsKey(key)) {
367
- // caches.put(key, keyValue);
368
- //}
369
- //if (caches.size() % max_pre_write_count == 0) {
370
- // try {
371
- // commitSecondData(caches.values());
372
- // } finally {
373
- // caches.clear();
374
- // }
375
- //}
376
365
}
377
366
if (!param .getKeys ().isEmpty ()) {
378
367
boolean result = txnCommit (param , txnId , param .getTableId (), param .getPartId ());
@@ -518,56 +507,6 @@ private Iterator<KeyValue> getLocalIterator() {
518
507
return cache .scan (prefix );
519
508
}
520
509
521
- public void commitSecondData (Collection <KeyValue > secondData ) {
522
- CommitParam param = new CommitParam (dingoType , isolationLevel , txnId .seq ,
523
- commitTs , primaryKey , TransactionType .OPTIMISTIC );
524
- param .init (null );
525
- for (KeyValue keyValue : secondData ) {
526
- CommonId tableId = indexTable .tableId ;
527
- int from = 1 ;
528
- //Arrays.copyOfRange(keyValue.getKey(), from, from += CommonId.LEN);
529
- from += CommonId .LEN ;
530
- CommonId newPartId = CommonId .decode (Arrays .copyOfRange (keyValue .getKey (), from , from += CommonId .LEN ));
531
- byte [] key = new byte [keyValue .getKey ().length - from ];
532
- System .arraycopy (keyValue .getKey (), from , key , 0 , key .length );
533
- CommonId partId = param .getPartId ();
534
- if (partId == null ) {
535
- partId = newPartId ;
536
- param .setPartId (partId );
537
- param .setTableId (tableId );
538
- param .addKey (key );
539
- } else if (partId .equals (newPartId )) {
540
- param .addKey (key );
541
- if (param .getKeys ().size () == max_pre_write_count ) {
542
- boolean result = txnCommit (param , txnId , tableId , partId );
543
- if (!result ) {
544
- throw new RuntimeException (txnId + " " + partId + ",txnCommit false,PrimaryKey:"
545
- + Arrays .toString (param .getPrimaryKey ()));
546
- }
547
- param .getKeys ().clear ();
548
- param .setPartId (null );
549
- }
550
- } else {
551
- boolean result = txnCommit (param , txnId , param .getTableId (), partId );
552
- if (!result ) {
553
- throw new RuntimeException (txnId + " " + partId + ",txnCommit false,PrimaryKey:"
554
- + Arrays .toString (param .getPrimaryKey ()));
555
- }
556
- param .getKeys ().clear ();
557
- param .addKey (key );
558
- param .setPartId (newPartId );
559
- param .setTableId (tableId );
560
- }
561
- }
562
- if (!param .getKeys ().isEmpty ()) {
563
- boolean result = txnCommit (param , txnId , param .getTableId (), param .getPartId ());
564
- if (!result ) {
565
- throw new RuntimeException (txnId + " " + param .getPartId ()
566
- + ",txnCommit false,PrimaryKey:" + Arrays .toString (param .getPrimaryKey ()));
567
- }
568
- }
569
- }
570
-
571
510
public TxnLocalData getTxnLocalData (Object [] tuplesTmp ) {
572
511
KeyValue keyValue = wrap (indexCodec ::encode ).apply (tuplesTmp );
573
512
NavigableMap <ByteArrayUtils .ComparableByteArray , RangeDistribution > ranges =
0 commit comments