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/10 16:43:51 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1158: Require x tservers on start

keith-turner commented on a change in pull request #1158: Require x tservers on start
URL: https://github.com/apache/accumulo/pull/1158#discussion_r282958457
 
 

 ##########
 File path: server/master/src/main/java/org/apache/accumulo/master/util/TserverStartThreshold.java
 ##########
 @@ -0,0 +1,259 @@
+/*
+ * 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 requested 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.master.util;
+
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.Property;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * User configurable guard that can block for a threshold of tservers to be registered in zookeeper
+ * and / or a max wait time is reached. The behaviour is controlled through three properties:
+ * <ul>
+ * <li>MASTER_STARTUP_TSERVER_AVAIL_MIN_COUNT - the number of tservers requested before proceeding.
+ * When set to 0 (the default) this is a noop, no blocking occurs and initial continues with
+ * original behaviour.</li>
+ * <li>MASTER_STARTUP_TSERVER_AVAIL_MAX_WAIT - the maximum time the method will block, waiting for
+ * tservers to register in zookeeper.</li>
+ * <li>MASTER_STARTUP_TSERVER_AVAIL_ABORT_ENABLED - controls the behaviour when tserver count and
+ * max wait time are set. When disabled (the default) initialization will continue with ant tservers
+ * available. When enabled, an exception is thrown to abort initialization.</li>
+ * </ul>
+ *
+ * <pre>
+ * {@code
+ *  The interactions of the properties is described in the following table:
+ *    # tservers    max wait   abort enabled            behaviour
+ *        < 1           x           x          Default. noop - no blocking, original behaviour
+ *       >= 1           0           x          Will block, potentially indefinitely until tserver
+ *                                             count reached.
+ *       >= 1         > 0         false        Will block up to max wait. Will continue if tserver
+ *                                             count not reached within max wait timeout period.
+ *       >= 1         > 0         true         Will block up to max wait. Will throw
+ *                                             IllegalStateException exception if tserver
+ *                                             count not reached within max wait timeout period.
+ * }
+ * </pre>
+ *
+ * This is a ome time guard and does not make any guarantee as to the number of tservers that remain
+ * available after this method returns.
+ *
+ * @since 1.9.4
+ */
+public class TserverStartThreshold {
 
 Review comment:
   Did you consider using Accumulo's Retry code in the implementation of this class?

----------------------------------------------------------------
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