Skip to content

Commit

Permalink
Merge branch '3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ctubbsii committed Aug 28, 2024
2 parents 3ab133c + 1d365a9 commit df8a367
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.accumulo.core.file.rfile;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;

Expand Down Expand Up @@ -237,7 +238,8 @@ protected static void checkIndex(Reader reader) throws IOException {
}

static Key newKey(String row, String cf, String cq, String cv, long ts) {
return new Key(row.getBytes(), cf.getBytes(), cq.getBytes(), cv.getBytes(), ts);
return new Key(row.getBytes(UTF_8), cf.getBytes(UTF_8), cq.getBytes(UTF_8), cv.getBytes(UTF_8),
ts);
}

static Value newValue(String val) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private TreeMap<Key,Value> createSortedMap(float hitRatio, int numRows, int numD
}
}
sb.append(" docID=").append(doc);
Key k = new Key(row, docColf, new Text(String.format("%010d", docid).getBytes()));
Key k = new Key(row, docColf, new Text(String.format("%010d", docid).getBytes(UTF_8)));
map.put(k, new Value(sb.toString()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.accumulo.hadoop.its.mapreduce;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
Expand Down Expand Up @@ -95,8 +96,8 @@ public static void runTest(AccumuloClient c, MiniAccumuloClusterImpl cluster)
int i = 0;
for (Entry<Key,Value> entry : s) {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] check = Base64.getEncoder().encode(md.digest(("row" + i).getBytes()));
assertEquals(entry.getValue().toString(), new String(check));
byte[] check = Base64.getEncoder().encode(md.digest(("row" + i).getBytes(UTF_8)));
assertEquals(entry.getValue().toString(), new String(check, UTF_8));
i++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.accumulo.minicluster;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -79,7 +80,7 @@ public void canConnectViaExistingZooKeeper() throws Exception {
CuratorFrameworkFactory.newClient(zooKeeper.getConnectString(), new RetryOneTime(1))) {
curatorClient.start();
assertNotNull(curatorClient.checkExists().forPath(zkTablePath));
assertEquals(tableName, new String(curatorClient.getData().forPath(zkTablePath)));
assertEquals(tableName, new String(curatorClient.getData().forPath(zkTablePath), UTF_8));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.accumulo.manager.compaction;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType.ECOMP;
import static org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType.OPID;
import static org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType.SELECTED;
Expand Down Expand Up @@ -282,7 +283,7 @@ public void testCoordinatorRestartOneRunningCompaction() throws Exception {
TExternalCompactionJob job = EasyMock.createNiceMock(TExternalCompactionJob.class);
expect(job.getExternalCompactionId()).andReturn(eci.toString()).anyTimes();
TKeyExtent extent = new TKeyExtent();
extent.setTable("1".getBytes());
extent.setTable("1".getBytes(UTF_8));
runningCompactions.add(new RunningCompaction(job, tserverAddr.toString(), GROUP_ID.toString()));

AuditedSecurityOperation security = EasyMock.createNiceMock(AuditedSecurityOperation.class);
Expand Down

0 comments on commit df8a367

Please sign in to comment.