You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/12/10 19:00:22 UTC
[GitHub] keith-turner opened a new issue #816: Create a metadata mutation
builder
keith-turner opened a new issue #816: Create a metadata mutation builder
URL: https://github.com/apache/accumulo/issues/816
The function `addNewTablet()` at [MasterMetadataUtil line 67](https://github.com/apache/accumulo/blob/5484fa80022c52784d4000cdd422941fddec1441/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java#L67) contains a lot of code to construct a metadata table mutation. It would be nice to replace this code with something like the following.
```java
TabletMutation.Builder builder = TabletMutation.builder().for(extent)
.directory(path)
.time(time);
if (lastFlushID > 0)
builder.flushId(lastFlushID);
if (lastCompactID > 0)
builder.compactId(lastCompactID);
builder.dataFiles(datafileSizes);
builder.bulkLoads(bulkLoadedFiles);
Mutation m = builder.build();
```
Doing this would centralize the code for serializing tablet metadata for write. It should be designed by using similar methods names to [TabletMetadata](https://github.com/apache/accumulo/blob/5484fa80022c52784d4000cdd422941fddec1441/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java) which is an abstraction for deserializing and using tablet metadata. Not sure, but it may be useful if the same builder could build a mutation or TabletMetadata object.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services