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 2022/04/15 19:34:31 UTC
[GitHub] [accumulo] DomGarguilo commented on a diff in pull request #2636: Update Apache parent POM, modernizer
DomGarguilo commented on code in PR #2636:
URL: https://github.com/apache/accumulo/pull/2636#discussion_r851429539
##########
core/src/main/java/org/apache/accumulo/core/client/rfile/RFileWriterBuilder.java:
##########
@@ -98,7 +98,8 @@ public RFileWriter build() throws IOException {
userProps.putAll(samplerProps);
if (!userProps.isEmpty()) {
- acuconf = new ConfigurationCopy(Iterables.concat(acuconf, userProps.entrySet()));
+ acuconf =
+ new ConfigurationCopy(Stream.concat(acuconf.stream(), userProps.entrySet().stream()));
Review Comment:
It seems weird that we would need to convert from a stream right back to an Iterable instead of keeping it this way. I guess the modernizer will complain if you don't do it this way and keep this as an iterable.
##########
server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/PrepBulkImportTest.java:
##########
@@ -79,14 +79,11 @@ List<KeyExtent> createExtents(Iterable<String> rowsIter) {
Iterable<List<KeyExtent>> powerSet(KeyExtent... extents) {
Set<Set<KeyExtent>> powerSet = Sets.powerSet(Set.of(extents));
-
- return Iterables.transform(powerSet, set -> {
+ return () -> powerSet.stream().map(set -> {
List<KeyExtent> list = new ArrayList<>(set);
-
Collections.sort(list);
-
return list;
- });
+ }).iterator();
Review Comment:
Not sure if its worth it but this could return a stream instead of an Iterable and then be used with `powerSet().forEach`.
EDIT: It could potentially also accept a Stream of Extents too if that would be better.
##########
core/src/main/java/org/apache/accumulo/core/conf/ConfigurationCopy.java:
##########
@@ -42,16 +43,24 @@ public ConfigurationCopy(Map<String,String> config) {
this(config.entrySet());
}
+ /**
+ * Creates a new configuration.
+ *
+ * @param config
+ * configuration property stream to use for copying
+ */
+ public ConfigurationCopy(Stream<Entry<String,String>> config) {
+ this(() -> config.iterator());
Review Comment:
```suggestion
this(config::iterator);
```
--
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