ddanielr commented on code in PR #4682:
URL: https://github.com/apache/accumulo/pull/4682#discussion_r1644633401
##########
core/src/main/java/org/apache/accumulo/core/metadata/ScanServerRefTabletFile.java:
##########
@@ -22,38 +22,85 @@
import java.util.Objects;
import java.util.UUID;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
+import
org.apache.accumulo.core.metadata.schema.MetadataSchema.OldScanServerFileReferenceSection;
+import
org.apache.accumulo.core.metadata.schema.MetadataSchema.ScanServerFileReferenceSection;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
public class ScanServerRefTabletFile extends TabletFile {
+ @SuppressWarnings("deprecation")
+ private static final String oldPrefix =
OldScanServerFileReferenceSection.getRowPrefix();
+ private final String prefix;
private final Value NULL_VALUE = new Value(new byte[0]);
- private final Text colf;
- private final Text colq;
+ private final Text serverAddress;
+ private final Text uuid;
- public ScanServerRefTabletFile(String file, String serverAddress, UUID
serverLockUUID) {
+ public ScanServerRefTabletFile(UUID serverLockUUID, String serverAddress,
String file) {
super(new Path(URI.create(file)));
- this.colf = new Text(serverAddress);
- this.colq = new Text(serverLockUUID.toString());
+ // For new data, always use the current prefix
+ prefix = ScanServerFileReferenceSection.getRowPrefix();
+ this.serverAddress = new Text(serverAddress);
+ uuid = new Text(serverLockUUID.toString());
}
- public ScanServerRefTabletFile(String file, Text colf, Text colq) {
- super(new Path(URI.create(file)));
- this.colf = colf;
- this.colq = colq;
+ public ScanServerRefTabletFile(Key k) {
+ super(new Path(URI.create(extractFile(k))));
+ serverAddress = k.getColumnFamily();
+ if (isOldPrefix(k)) {
+ prefix = oldPrefix;
+ uuid = new Text(k.getColumnQualifier().toString());
+ } else {
+ prefix = ScanServerFileReferenceSection.getRowPrefix();
+ uuid = new Text(k.getRow().toString().substring(prefix.length()));
+ }
+ }
+
+ public Mutation putMutation() {
+ Mutation mutation;
+ if (Objects.equals(prefix, oldPrefix)) {
Review Comment:
No, we only need to support old `putDelete` mutation types.
--
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]