keith-turner commented on code in PR #5982:
URL: https://github.com/apache/accumulo/pull/5982#discussion_r2557745339
##########
core/src/main/java/org/apache/accumulo/core/data/LoadPlan.java:
##########
@@ -510,4 +524,41 @@ public static LoadPlan compute(URI file,
Map<String,String> properties,
return builder.build();
}
}
+
+ /**
+ * Computes a load plan for a rfile based on the minimum and maximum row
present across all
+ * locality groups.
+ *
+ * @param properties used when opening the rfile, see
+ * {@link
org.apache.accumulo.core.client.rfile.RFile.ScannerOptions#withTableProperties(Map)}
+ *
+ * @return a load plan of type {@link RangeType#FILE}
+ * @since 2.1.5
+ */
+ public static LoadPlan compute(URI file, Map<String,String> properties)
throws IOException {
+ var path = new Path(file);
+ var conf = new Configuration();
+ var fs = FileSystem.get(path.toUri(), conf);
+ CryptoService cs =
+ CryptoFactoryLoader.getServiceForClient(CryptoEnvironment.Scope.TABLE,
properties);
+ CachableBlockFile.CachableBuilder cb =
+ new CachableBlockFile.CachableBuilder().fsPath(fs,
path).conf(conf).cryptoService(cs);
+ try (var reader = new
org.apache.accumulo.core.file.rfile.RFile.Reader(cb)) {
Review Comment:
Not sure, I will look into that. I think I copied this code from somewhere
(maybe the Rfile print info code) that was doing what I needed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]