Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E21E8200D1B for ; Thu, 12 Oct 2017 15:35:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DF12D1609E8; Thu, 12 Oct 2017 13:35:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 307B01609CD for ; Thu, 12 Oct 2017 15:35:00 +0200 (CEST) Received: (qmail 89427 invoked by uid 500); 12 Oct 2017 13:34:59 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 89418 invoked by uid 99); 12 Oct 2017 13:34:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2017 13:34:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 382ECDF9AF; Thu, 12 Oct 2017 13:34:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chia7712@apache.org To: commits@hbase.apache.org Message-Id: <3e2da82f77614bc9813ca49b7f3cb6e1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-18991 Removed RegionMergeRequest Date: Thu, 12 Oct 2017 13:34:59 +0000 (UTC) archived-at: Thu, 12 Oct 2017 13:35:01 -0000 Repository: hbase Updated Branches: refs/heads/master 023d4f1ae -> 138a7392e HBASE-18991 Removed RegionMergeRequest Signed-off-by: Chia-Ping Tsai Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/138a7392 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/138a7392 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/138a7392 Branch: refs/heads/master Commit: 138a7392e305d61120242bcdcb333b448eeee28b Parents: 023d4f1 Author: Jan Hentschel Authored: Thu Oct 12 10:21:20 2017 +0200 Committer: Chia-Ping Tsai Committed: Thu Oct 12 21:28:07 2017 +0800 ---------------------------------------------------------------------- .../hbase/regionserver/RegionMergeRequest.java | 112 ------------------- 1 file changed, 112 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/138a7392/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionMergeRequest.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionMergeRequest.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionMergeRequest.java deleted file mode 100644 index f9e93a1..0000000 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionMergeRequest.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Copyright The Apache Software Foundation - * - * 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.regionserver; - -import java.security.PrivilegedAction; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.client.RegionInfo; -import org.apache.hadoop.hbase.client.RegionInfoBuilder; -import org.apache.hadoop.hbase.regionserver.RegionServerServices.RegionStateTransitionContext; -import org.apache.hadoop.hbase.security.User; -import org.apache.yetus.audience.InterfaceAudience; - -import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions; -import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode; - -/** - * Handles processing region merges. Put in a queue, owned by HRegionServer. - */ -// TODO:UNUSED: REMOVE!!! -@InterfaceAudience.Private -class RegionMergeRequest implements Runnable { - private static final Log LOG = LogFactory.getLog(RegionMergeRequest.class); - private final RegionInfo region_a; - private final RegionInfo region_b; - private final HRegionServer server; - private final boolean forcible; - private final User user; - - RegionMergeRequest(Region a, Region b, HRegionServer hrs, boolean forcible, - long masterSystemTime, User user) { - Preconditions.checkNotNull(hrs); - this.region_a = a.getRegionInfo(); - this.region_b = b.getRegionInfo(); - this.server = hrs; - this.forcible = forcible; - this.user = user; - } - - @Override - public String toString() { - return "MergeRequest,regions:" + region_a + ", " + region_b + ", forcible=" - + forcible; - } - - private void doMerge() { - boolean success = false; - //server.metricsRegionServer.incrMergeRequest(); - - if (user != null && user.getUGI() != null) { - user.getUGI().doAs (new PrivilegedAction() { - @Override - public Void run() { - requestRegionMerge(); - return null; - } - }); - } else { - requestRegionMerge(); - } - } - - private void requestRegionMerge() { - final TableName table = region_a.getTable(); - if (!table.equals(region_b.getTable())) { - LOG.error("Can't merge regions from two different tables: " + region_a + ", " + region_b); - return; - } - - // TODO: fake merged region for compat with the report protocol - final RegionInfo merged = RegionInfoBuilder.newBuilder(table).build(); - - // Send the split request to the master. the master will do the validation on the split-key. - // The parent region will be unassigned and the two new regions will be assigned. - // hri_a and hri_b objects may not reflect the regions that will be created, those objectes - // are created just to pass the information to the reportRegionStateTransition(). - if (!server.reportRegionStateTransition(new RegionStateTransitionContext( - TransitionCode.READY_TO_MERGE, HConstants.NO_SEQNUM, -1, merged, region_a, region_b))) { - LOG.error("Unable to ask master to merge: " + region_a + ", " + region_b); - } - } - - @Override - public void run() { - if (this.server.isStopping() || this.server.isStopped()) { - LOG.debug("Skipping merge because server is stopping=" - + this.server.isStopping() + " or stopped=" + this.server.isStopped()); - return; - } - - doMerge(); - } -}