You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "DomGarguilo (via GitHub)" <gi...@apache.org> on 2023/12/28 19:39:33 UTC

[PR] Small improvements to new AccumuloStore related code [accumulo]

DomGarguilo opened a new pull request, #4121:
URL: https://github.com/apache/accumulo/pull/4121

   (no comment)


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Small improvements to new AccumuloStore related code [accumulo]

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #4121:
URL: https://github.com/apache/accumulo/pull/4121#discussion_r1442174877


##########
core/src/main/java/org/apache/accumulo/core/fate/AbstractFateStore.java:
##########
@@ -52,7 +52,7 @@ public abstract class AbstractFateStore<T> implements FateStore<T> {
   private static final Logger log = LoggerFactory.getLogger(AbstractFateStore.class);
 
   protected final Set<Long> reserved;
-  protected final Map<Long,Long> defered;
+  protected final Map<Long,Long> deferred;

Review Comment:
   Added #4128 to fix the things mentioned in 2.1



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Small improvements to new AccumuloStore related code [accumulo]

Posted by "cshannon (via GitHub)" <gi...@apache.org>.
cshannon commented on code in PR #4121:
URL: https://github.com/apache/accumulo/pull/4121#discussion_r1441006495


##########
core/src/main/java/org/apache/accumulo/core/fate/AbstractFateStore.java:
##########
@@ -52,7 +52,7 @@ public abstract class AbstractFateStore<T> implements FateStore<T> {
   private static final Logger log = LoggerFactory.getLogger(AbstractFateStore.class);
 
   protected final Set<Long> reserved;
-  protected final Map<Long,Long> defered;
+  protected final Map<Long,Long> deferred;

Review Comment:
   This is refactored from the ZooStore and is actually misspelled in 2.1 and main as well so we should fix it there too. https://github.com/apache/accumulo/blob/d97317945290fcd4e3a4eb8b3cf7e427fcc322bd/core/src/main/java/org/apache/accumulo/core/fate/ZooStore.java#L64



##########
core/src/main/java/org/apache/accumulo/core/fate/accumulo/AccumuloStore.java:
##########
@@ -188,27 +186,23 @@ public long timeCreated() {
       return scanTx(scanner -> {
         scanner.setRange(getRow(tid));
         TxColumnFamily.CREATE_TIME_COLUMN.fetch(scanner);
-        return StreamSupport.stream(scanner.spliterator(), false)
-            .map(e -> Long.parseLong(e.getValue().toString())).findFirst().orElse(0L);
+        return scanner.stream().map(e -> Long.parseLong(e.getValue().toString())).findFirst()
+            .orElse(0L);
       });
     }
 
     @Override
     public void push(Repo<T> repo) throws StackOverflowException {
       verifyReserved(true);
 
-      try {
-        Optional<Integer> top = findTop();
-
-        if (top.filter(t -> t >= maxRepos).isPresent()) {
-          throw new StackOverflowException("Repo stack size too large");
-        }
+      Optional<Integer> top = findTop();
 
-        FateMutator<T> fateMutator = newMutator(tid);
-        fateMutator.putRepo(top.map(t -> t + 1).orElse(1), repo).mutate();
-      } catch (StackOverflowException soe) {

Review Comment:
   Another nice catch as it makes no sense to catch and immediately re-throw here



##########
core/src/main/java/org/apache/accumulo/core/fate/AbstractFateStore.java:
##########
@@ -62,16 +62,13 @@ public abstract class AbstractFateStore<T> implements FateStore<T> {
 
   public AbstractFateStore() {
     this.reserved = new HashSet<>();
-    this.defered = new HashMap<>();
+    this.deferred = new HashMap<>();
   }
 
   public static byte[] serialize(Object o) {
-    try {
-      ByteArrayOutputStream baos = new ByteArrayOutputStream();
-      ObjectOutputStream oos = new ObjectOutputStream(baos);
+    try (ByteArrayOutputStream baos = new ByteArrayOutputStream();

Review Comment:
   Same comment, this is also an issue in 2.1 https://github.com/apache/accumulo/blob/d97317945290fcd4e3a4eb8b3cf7e427fcc322bd/core/src/main/java/org/apache/accumulo/core/fate/ZooStore.java#L69



##########
core/src/main/java/org/apache/accumulo/core/fate/accumulo/AccumuloStore.java:
##########
@@ -75,8 +74,7 @@ protected List<String> getTransactions() {
     return scanTx(scanner -> {
       scanner.setRange(new Range());
       TxColumnFamily.STATUS_COLUMN.fetch(scanner);
-      return StreamSupport.stream(scanner.spliterator(), false)
-          .map(e -> e.getKey().getRow().toString()).collect(Collectors.toList());
+      return scanner.stream().map(e -> e.getKey().getRow().toString()).collect(Collectors.toList());

Review Comment:
   Nice catch, for some reason I missed the stream() method on the scanner



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Small improvements to new AccumuloStore related code [accumulo]

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on PR #4121:
URL: https://github.com/apache/accumulo/pull/4121#issuecomment-1875652299

   > Does this set up a merge conflict with #4126 ? Not necessarily a problem more of something to watch out for depending on the merge order.
   
   Yea looks like there is some overlap but shouldn't be too much of a process to resolve.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Small improvements to new AccumuloStore related code [accumulo]

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo merged PR #4121:
URL: https://github.com/apache/accumulo/pull/4121


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Small improvements to new AccumuloStore related code [accumulo]

Posted by "EdColeman (via GitHub)" <gi...@apache.org>.
EdColeman commented on PR #4121:
URL: https://github.com/apache/accumulo/pull/4121#issuecomment-1875649012

   Does this set up a merge conflict with #4126 ?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Small improvements to new AccumuloStore related code [accumulo]

Posted by "DomGarguilo (via GitHub)" <gi...@apache.org>.
DomGarguilo commented on code in PR #4121:
URL: https://github.com/apache/accumulo/pull/4121#discussion_r1442149111


##########
core/src/main/java/org/apache/accumulo/core/fate/AbstractFateStore.java:
##########
@@ -52,7 +52,7 @@ public abstract class AbstractFateStore<T> implements FateStore<T> {
   private static final Logger log = LoggerFactory.getLogger(AbstractFateStore.class);
 
   protected final Set<Long> reserved;
-  protected final Map<Long,Long> defered;
+  protected final Map<Long,Long> deferred;

Review Comment:
   Looks like the same thing was fixed in #4126 which is waiting to be merged into 2.1 so I think we can just let it be handled there if it ends up being merged.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org