dlmarion commented on code in PR #5627:
URL: https://github.com/apache/accumulo/pull/5627#discussion_r2138331637
##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletStateChangeIterator.java:
##########
@@ -264,18 +270,23 @@ public static void setMerges(IteratorSetting cfg,
Collection<MergeInfo> merges)
cfg.addOption(MERGES_OPTION, encoded);
}
- public static void setMigrations(IteratorSetting cfg, Collection<KeyExtent>
migrations) {
- DataOutputBuffer buffer = new DataOutputBuffer();
+ static String encodeMigrations(Collection<KeyExtent> migrations) {
try {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
Review Comment:
could use try-with-resources for gzo and dos
##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletStateChangeIterator.java:
##########
@@ -90,17 +96,17 @@ public void init(SortedKeyValueIterator<Key,Value> source,
Map<String,String> op
}
}
- private Set<KeyExtent> parseMigrations(String migrations) {
+ static Set<KeyExtent> decodeMigrations(String migrations) {
if (migrations == null) {
return Collections.emptySet();
}
try {
Set<KeyExtent> result = new HashSet<>();
- DataInputBuffer buffer = new DataInputBuffer();
byte[] data = Base64.getDecoder().decode(migrations);
- buffer.reset(data, data.length);
- while (buffer.available() > 0) {
- result.add(KeyExtent.readFrom(buffer));
+ DataInputStream input =
Review Comment:
Do we need to close these streams to release resources?
--
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]