You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/09/12 05:28:24 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1356: Use concurrent map instead of cache for bulkImported map

ctubbsii commented on a change in pull request #1356: Use concurrent map instead of cache for bulkImported map
URL: https://github.com/apache/accumulo/pull/1356#discussion_r323560626
 
 

 ##########
 File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
 ##########
 @@ -254,8 +253,13 @@ public long getDataSourceDeletions() {
   // tablet lock.
   private final Set<FileRef> bulkImporting = new HashSet<>();
 
-  // Files that were successfully bulk imported.
-  private final Cache<Long,List<FileRef>> bulkImported = CacheBuilder.newBuilder().build();
+  // Files that were successfully bulk imported. Using a concurrent map supports non-locking
+  // operations on the key set which is useful for the periodic task that cleans up completed bulk
+  // imports for all tablets. However the values of this map are ArrayList which do not support
+  // concurrency. This is ok because all operations on the values are done while the tablet lock is
+  // held.
+  private final ConcurrentHashMap<Long,List<FileRef>> bulkImported =
+      new ConcurrentHashMap<Long,List<FileRef>>();
 
 Review comment:
   This should use diamond operator.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services