@@ -191,6 +191,7 @@ public class ArcusClient extends FrontCacheMemcachedClient implements ArcusClien
191191 private static final Logger arcusLogger = LoggerFactory .getLogger (ArcusClient .class );
192192 private static final String ARCUS_ADMIN_ADDR = "127.0.0.1:2181" ;
193193 private static final String DEFAULT_ARCUS_CLIENT_NAME = "ArcusClient" ;
194+ public static final int MAX_PIPED_ITEM_COUNT = 500 ;
194195
195196 private final Transcoder <Object > collectionTranscoder ;
196197
@@ -844,10 +845,10 @@ public void complete() {
844845 // got status
845846 public void gotStatus (Integer index , OperationStatus status ) {
846847 if (status instanceof CollectionOperationStatus ) {
847- rv .addEachResult (index + (idx * CollectionPipedUpdate . MAX_PIPED_ITEM_COUNT ),
848+ rv .addEachResult (index + (idx * MAX_PIPED_ITEM_COUNT ),
848849 (CollectionOperationStatus ) status );
849850 } else {
850- rv .addEachResult (index + (idx * CollectionPipedUpdate . MAX_PIPED_ITEM_COUNT ),
851+ rv .addEachResult (index + (idx * MAX_PIPED_ITEM_COUNT ),
851852 new CollectionOperationStatus (status ));
852853 }
853854 }
@@ -1774,11 +1775,11 @@ public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncBopPip
17741775
17751776 List <CollectionPipedInsert <T >> insertList = new ArrayList <>();
17761777
1777- if (elements .size () <= CollectionPipedInsert . MAX_PIPED_ITEM_COUNT ) {
1778+ if (elements .size () <= MAX_PIPED_ITEM_COUNT ) {
17781779 insertList .add (new BTreePipedInsert <>(key , elements , attributesForCreate , tc ));
17791780 } else {
17801781 PartitionedMap <Long , T > list = new PartitionedMap <>(
1781- elements , CollectionPipedInsert . MAX_PIPED_ITEM_COUNT );
1782+ elements , MAX_PIPED_ITEM_COUNT );
17821783 for (Map <Long , T > elementMap : list ) {
17831784 insertList .add (new BTreePipedInsert <>(key , elementMap , attributesForCreate , tc ));
17841785 }
@@ -1798,11 +1799,11 @@ public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncBopPip
17981799
17991800 List <CollectionPipedInsert <T >> insertList = new ArrayList <>();
18001801
1801- if (elements .size () <= CollectionPipedInsert . MAX_PIPED_ITEM_COUNT ) {
1802+ if (elements .size () <= MAX_PIPED_ITEM_COUNT ) {
18021803 insertList .add (new ByteArraysBTreePipedInsert <>(key , elements , attributesForCreate , tc ));
18031804 } else {
18041805 PartitionedList <Element <T >> list = new PartitionedList <>(
1805- elements , CollectionPipedInsert . MAX_PIPED_ITEM_COUNT );
1806+ elements , MAX_PIPED_ITEM_COUNT );
18061807 for (List <Element <T >> elementList : list ) {
18071808 insertList .add (new ByteArraysBTreePipedInsert <>(key , elementList , attributesForCreate , tc ));
18081809 }
@@ -1826,11 +1827,10 @@ public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncMopPip
18261827
18271828 List <CollectionPipedInsert <T >> insertList = new ArrayList <>();
18281829
1829- if (elements .size () <= CollectionPipedInsert . MAX_PIPED_ITEM_COUNT ) {
1830+ if (elements .size () <= MAX_PIPED_ITEM_COUNT ) {
18301831 insertList .add (new MapPipedInsert <>(key , elements , attributesForCreate , tc ));
18311832 } else {
1832- PartitionedMap <String , T > list = new PartitionedMap <>(
1833- elements , CollectionPipedInsert .MAX_PIPED_ITEM_COUNT );
1833+ PartitionedMap <String , T > list = new PartitionedMap <>(elements , MAX_PIPED_ITEM_COUNT );
18341834 for (Map <String , T > elementMap : list ) {
18351835 insertList .add (new MapPipedInsert <>(key , elementMap , attributesForCreate , tc ));
18361836 }
@@ -1850,11 +1850,10 @@ public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncLopPip
18501850
18511851 List <CollectionPipedInsert <T >> insertList = new ArrayList <>();
18521852
1853- if (valueList .size () <= CollectionPipedInsert . MAX_PIPED_ITEM_COUNT ) {
1853+ if (valueList .size () <= MAX_PIPED_ITEM_COUNT ) {
18541854 insertList .add (new ListPipedInsert <>(key , index , valueList , attributesForCreate , tc ));
18551855 } else {
1856- PartitionedList <T > list = new PartitionedList <>(valueList ,
1857- CollectionPipedInsert .MAX_PIPED_ITEM_COUNT );
1856+ PartitionedList <T > list = new PartitionedList <>(valueList , MAX_PIPED_ITEM_COUNT );
18581857 for (List <T > elementList : list ) {
18591858 insertList .add (new ListPipedInsert <>(key , index , elementList , attributesForCreate , tc ));
18601859 }
@@ -1874,11 +1873,10 @@ public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncSopPip
18741873
18751874 List <CollectionPipedInsert <T >> insertList = new ArrayList <>();
18761875
1877- if (valueList .size () <= CollectionPipedInsert . MAX_PIPED_ITEM_COUNT ) {
1876+ if (valueList .size () <= MAX_PIPED_ITEM_COUNT ) {
18781877 insertList .add (new SetPipedInsert <>(key , valueList , attributesForCreate , tc ));
18791878 } else {
1880- PartitionedList <T > list = new PartitionedList <>(valueList ,
1881- CollectionPipedInsert .MAX_PIPED_ITEM_COUNT );
1879+ PartitionedList <T > list = new PartitionedList <>(valueList , MAX_PIPED_ITEM_COUNT );
18821880 for (List <T > elementList : list ) {
18831881 insertList .add (new SetPipedInsert <>(key , elementList , attributesForCreate , tc ));
18841882 }
@@ -2310,11 +2308,11 @@ public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncBopPip
23102308
23112309 List <CollectionPipedUpdate <T >> updateList = new ArrayList <>();
23122310
2313- if (elements .size () <= CollectionPipedUpdate . MAX_PIPED_ITEM_COUNT ) {
2311+ if (elements .size () <= MAX_PIPED_ITEM_COUNT ) {
23142312 updateList .add (new BTreePipedUpdate <>(key , elements , tc ));
23152313 } else {
23162314 PartitionedList <Element <T >> list = new PartitionedList <>(
2317- elements , CollectionPipedUpdate . MAX_PIPED_ITEM_COUNT );
2315+ elements , MAX_PIPED_ITEM_COUNT );
23182316 for (List <Element <T >> elementList : list ) {
23192317 updateList .add (new BTreePipedUpdate <>(key , elementList , tc ));
23202318 }
@@ -2343,11 +2341,11 @@ public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncMopPip
23432341
23442342 List <CollectionPipedUpdate <T >> updateList = new ArrayList <>();
23452343
2346- if (elements .size () <= CollectionPipedUpdate . MAX_PIPED_ITEM_COUNT ) {
2344+ if (elements .size () <= MAX_PIPED_ITEM_COUNT ) {
23472345 updateList .add (new MapPipedUpdate <>(key , elements , tc ));
23482346 } else {
23492347 PartitionedMap <String , T > list = new PartitionedMap <>(
2350- elements , CollectionPipedUpdate . MAX_PIPED_ITEM_COUNT );
2348+ elements , MAX_PIPED_ITEM_COUNT );
23512349
23522350 for (Map <String , T > elementMap : list ) {
23532351 updateList .add (new MapPipedUpdate <>(key , elementMap , tc ));
@@ -2943,10 +2941,10 @@ <T> CollectionFuture<Map<T, Boolean>> asyncSetPipedExist(
29432941 throw new IllegalArgumentException (
29442942 "The number of piped operations must be larger than 0." );
29452943 }
2946- if (exist .getItemCount () > SetPipedExist . MAX_PIPED_ITEM_COUNT ) {
2944+ if (exist .getItemCount () > MAX_PIPED_ITEM_COUNT ) {
29472945 throw new IllegalArgumentException (
29482946 "The number of piped operations must not exceed a maximum of "
2949- + SetPipedExist . MAX_PIPED_ITEM_COUNT + "." );
2947+ + MAX_PIPED_ITEM_COUNT + "." );
29502948 }
29512949
29522950 final CountDownLatch latch = new CountDownLatch (1 );
@@ -3107,10 +3105,10 @@ public void complete() {
31073105 // got status
31083106 public void gotStatus (Integer index , OperationStatus status ) {
31093107 if (status instanceof CollectionOperationStatus ) {
3110- rv .addEachResult (index + (idx * CollectionPipedInsert . MAX_PIPED_ITEM_COUNT ),
3108+ rv .addEachResult (index + (idx * MAX_PIPED_ITEM_COUNT ),
31113109 (CollectionOperationStatus ) status );
31123110 } else {
3113- rv .addEachResult (index + (idx * CollectionPipedInsert . MAX_PIPED_ITEM_COUNT ),
3111+ rv .addEachResult (index + (idx * MAX_PIPED_ITEM_COUNT ),
31143112 new CollectionOperationStatus (status ));
31153113 }
31163114 }
0 commit comments