use of org.apache.hadoop.hdds.utils.db.CodecRegistry in project ozone by apache.
the class KeyManagerImpl method getNextGreaterString.
private String getNextGreaterString(String volumeName, String bucketName, String keyPrefix) throws IOException {
// Increment the last character of the string and return the new ozone key.
Preconditions.checkArgument(!Strings.isNullOrEmpty(keyPrefix), "Key prefix is null or empty");
CodecRegistry codecRegistry = ((RDBStore) metadataManager.getStore()).getCodecRegistry();
byte[] keyPrefixInBytes = codecRegistry.asRawData(keyPrefix);
keyPrefixInBytes[keyPrefixInBytes.length - 1]++;
String nextPrefix = codecRegistry.asObject(keyPrefixInBytes, String.class);
return metadataManager.getOzoneKey(volumeName, bucketName, nextPrefix);
}
Aggregations