Apache9 commented on a change in pull request #3115:
URL: https://github.com/apache/hbase/pull/3115#discussion_r611617433



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
##########
@@ -300,6 +300,8 @@
   // server manager to deal with region server info
   private volatile ServerManager serverManager;
 
+  private volatile CompactionServerManager compactionServerManager;

Review comment:
       Is it possible to reuse ServerManager here? Just asking...

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/compactionserver/HCompactionServer.java
##########
@@ -0,0 +1,299 @@
+/**
+ * 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.hadoop.hbase.compactionserver;
+
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.AbstractRpcServices;
+import org.apache.hadoop.hbase.AbstractServer;
+import org.apache.hadoop.hbase.ChoreService;
+import org.apache.hadoop.hbase.CoordinatedStateManager;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.YouAreDeadException;
+import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;
+import org.apache.hadoop.hbase.log.HBaseMarkers;
+import org.apache.hadoop.hbase.security.SecurityConstants;
+import org.apache.hadoop.hbase.security.Superusers;
+import org.apache.hadoop.hbase.security.UserProvider;
+import org.apache.hadoop.hbase.util.Sleeper;
+import org.apache.hadoop.hbase.util.VersionInfo;
+import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
+import org.apache.hadoop.hbase.zookeeper.ZKUtil;
+import org.apache.hadoop.hbase.zookeeper.ZKWatcher;
+import org.apache.hadoop.ipc.RemoteException;
+
+import org.apache.yetus.audience.InterfaceAudience;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.hbase.thirdparty.com.google.protobuf.BlockingRpcChannel;
+import org.apache.hbase.thirdparty.com.google.protobuf.ServiceException;
+
+import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
+import 
org.apache.hadoop.hbase.shaded.protobuf.generated.CompactionServerStatusProtos;
+import 
org.apache.hadoop.hbase.shaded.protobuf.generated.CompactionServerStatusProtos.CompactionServerStatusService;
+
+@InterfaceAudience.Private
+public class HCompactionServer extends AbstractServer implements 
CompactionServerServices {
+
+  /** compaction server process name */
+  public static final String COMPACTIONSERVER = "compactionserver";
+  private static final Logger LOG = 
LoggerFactory.getLogger(HCompactionServer.class);
+
+  protected String getProcessName() {
+    return COMPACTIONSERVER;
+  }
+
+  @Override
+  public CoordinatedStateManager getCoordinatedStateManager() {
+    return null;
+  }
+
+  @Override
+  public ChoreService getChoreService() {
+    return null;
+  }
+
+  protected final CSRpcServices rpcServices;
+
+  // Stub to do region server status calls against the master.
+  private volatile CompactionServerStatusService.BlockingInterface cssStub;
+
+  /**
+   * Get the current master from ZooKeeper and open the RPC connection to it. 
To get a fresh
+   * connection, the current cssStub must be null. Method will block until a 
master is available.
+   * You can break from this block by requesting the server stop.
+   * @return master + port, or null if server has been stopped
+   */
+  private synchronized ServerName createCompactionServerStatusStub() {

Review comment:
       I think this only difference here between the similiar method in 
HRegionServer is how to call newStub? We need to use different types of 
protobuf Interface. So can we move this method up to AbstractServer?

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/compactionserver/CompactionServerServices.java
##########
@@ -0,0 +1,26 @@
+/**
+ * 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.hadoop.hbase.compactionserver;
+
+import org.apache.hadoop.hbase.Server;
+import org.apache.yetus.audience.InterfaceAudience;
+
+@InterfaceAudience.Private
+interface CompactionServerServices extends Server {

Review comment:
       What's this class used for?




-- 
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:
us...@infra.apache.org


Reply via email to