EdColeman commented on code in PR #3322: URL: https://github.com/apache/accumulo/pull/3322#discussion_r1173811131
########## server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader11to12.java: ########## @@ -0,0 +1,79 @@ +/* + * 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 + * + * https://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.manager.upgrade; + +import org.apache.accumulo.core.client.admin.TabletHostingGoal; +import org.apache.accumulo.core.data.TableId; +import org.apache.accumulo.core.metadata.MetadataTable; +import org.apache.accumulo.core.metadata.RootTable; +import org.apache.accumulo.core.metadata.schema.Ample.DataLevel; +import org.apache.accumulo.core.metadata.schema.Ample.TabletsMutator; +import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType; +import org.apache.accumulo.core.metadata.schema.TabletsMetadata; +import org.apache.accumulo.server.ServerContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Upgrader11to12 implements Upgrader { + + private static final Logger LOG = LoggerFactory.getLogger(Upgrader11to12.class); + + @Override + public void upgradeZookeeper(ServerContext context) { + LOG.info("setting root table stored hosting goal"); + addHostingGoalToRootTable(context); + } + + @Override + public void upgradeRoot(ServerContext context) { + LOG.info("setting metadata table hosting goal"); + addHostingGoalToMetadataTable(context); + } + + @Override + public void upgradeMetadata(ServerContext context) { + LOG.info("setting hosting goal on user tables"); + addHostingGoalToUserTables(context); + } + + private void addHostingGoalToSystemTable(ServerContext context, TableId tableId) { + TabletsMetadata tm = Review Comment: TabletMetadata - should be wrapped in try-with-resources (two places in this file) -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
