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 2019/05/16 15:01:00 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1151: WIP Initial stab at #816 abstracting accumulo metadata persistence

keith-turner commented on a change in pull request #1151: WIP Initial stab at #816 abstracting accumulo metadata persistence
URL: https://github.com/apache/accumulo/pull/1151#discussion_r284752899
 
 

 ##########
 File path: server/base/src/main/java/org/apache/accumulo/server/metadata/MetadataMutator.java
 ##########
 @@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.accumulo.server.metadata;
+
+import org.apache.accumulo.core.data.TableId;
+import org.apache.accumulo.core.dataImpl.KeyExtent;
+import org.apache.accumulo.core.metadata.schema.DataFileValue;
+import org.apache.accumulo.fate.zookeeper.ZooLock;
+import org.apache.accumulo.server.fs.FileRef;
+import org.apache.accumulo.server.master.state.TServerInstance;
+import org.apache.hadoop.io.Text;
+
+/**
+ * An abstraction layer for mutating Accumulo's persistent metadata. This metadata may be stored in
+ * Zookeeper or Accumulo's own metadata table.
+ *
+ * <p>
+ * Mutators created by this interface may only queue changes for persisting. There is no guarantee
+ * that any change is persisted until this object is closed.
+ *
+ * <p>
+ * This interface seeks to satisfy the following goals.
+ *
+ * <UL>
+ * <LI>The root tablet persists its data in Zookeeper. Metadata tablets persist their data in root
+ * tablet. All other tablets persist their data in the metadata table. This interface abstracts how
+ * and where information for a tablet is actually persisted.
+ * <LI>Before the creation of this interface, many concurrent metadata table updates resulted in
+ * separate synchronous RPCs. The design of this interface allows batching of metadata table updates
+ * within a tablet server for cluster wide efficiencies. Batching is not required by
+ * implementations, but the design of the interface makes it possible.
+ * <LI>Make code that updates Accumulo persistent metadata more concise. Before this interface
+ * existed, there was a lot of redundant and verbose code for updating metadata.
+ * <LI>Reduce specialized code for the root tablet. Currently there is specialized code to manage
+ * the root tablets files that is different from all other tablets. This interface is the beginning
+ * of an effort to remove this specialized code. See #936
+ * </UL>
+ */
+public interface MetadataMutator extends AutoCloseable {
+
+  public interface Factory {
 
 Review comment:
   It may not be needed.  My thinking was that it could make testing easier.  I will add TODO about removing.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services