brianloss commented on a change in pull request #1891: URL: https://github.com/apache/accumulo/pull/1891#discussion_r567999896
########## File path: core/src/main/java/org/apache/accumulo/core/spi/balancer/BalancerEnvironment.java ########## @@ -0,0 +1,88 @@ +/* + * 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.core.spi.balancer; + +import java.util.List; +import java.util.Map; + +import org.apache.accumulo.core.client.AccumuloException; +import org.apache.accumulo.core.client.AccumuloSecurityException; +import org.apache.accumulo.core.data.TableId; +import org.apache.accumulo.core.data.TabletId; +import org.apache.accumulo.core.spi.balancer.data.TabletServerId; +import org.apache.accumulo.core.spi.balancer.data.TabletStatistics; +import org.apache.accumulo.core.spi.common.ServiceEnvironment; + +/** + * This interface is an extension of {@link ServiceEnvironment} that exposes system level + * information that is specific to tablet balancing. + * + * @since 2.1.0 + */ +public interface BalancerEnvironment extends ServiceEnvironment { + /** + * Many Accumulo plugins are given table IDs as this is what Accumulo uses internally to identify + * tables. This provides a mapping of table names to table IDs for the purposes of translating + * and/or enumerating the existing tables. + */ + Map<String,TableId> getTableIdMap(); + + /** + * Accumulo plugins working with a table may need to know if the table is online or not before + * operating on it. + * + * @param tableId + * The id of the table to check. + * @return {@code true} if the table is online and {@code false} if not + */ + boolean isTableOnline(TableId tableId); + + /** + * Fetch the locations for each of {@code tableId}'s tablets from the metadata table. Review comment: Sure, makes sense. Updating along with the other suggested changes. ---------------------------------------------------------------- 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: [email protected]
