diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 5a2fbbd..13535fa 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -2489,6 +2489,28 @@ public class HBaseAdmin implements Admin { } } + /** + * Roll the log writer on all the active region servers. + * + * @return If lots of logs, flush the returned regions so next time through + * we can clean logs. Returns null if nothing to flush. Names are actual + * region names as returned by {@link HRegionInfo#getEncodedName()} + * @throws IOException if a remote or network exception occurs + */ + public synchronized byte[][] rollAllHLogWriters() throws IOException { + + byte[] data = execProcedureWithRet(HConstants.ROLLLOG_PROCEDURE_SIGNATURE, + HConstants.ROLLLOG_PROCEDURE_NAME, new HashMap()); + RollWALWriterResponse response = RollWALWriterResponse.parseFrom(data); + int regionCount = response.getRegionToFlushCount(); + byte[][] regionsToFlush = new byte[regionCount][]; + for (int i = 0; i < regionCount; i++) { + ByteString region = response.getRegionToFlush(i); + regionsToFlush[i] = region.toByteArray(); + } + return regionsToFlush; + } + public String[] getMasterCoprocessors() { try { return getClusterStatus().getMasterCoprocessors(); diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index b27679c..f5d1abd 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -1002,6 +1002,12 @@ public final class HConstants { public static final String HBASE_COORDINATED_STATE_MANAGER_CLASS = "hbase.coordinated.state.manager.class"; + /** Roll log procedure signature/type */ + public static final String ROLLLOG_PROCEDURE_SIGNATURE = "roll-log-proc"; + + /** Roll log procedure name */ + public static final String ROLLLOG_PROCEDURE_NAME = "roll-log"; + private HConstants() { // Can't be instantiated with this ctor. } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index e7b9db8..4b9e46d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -99,6 +99,7 @@ import org.apache.hadoop.hbase.monitoring.MonitoredTask; import org.apache.hadoop.hbase.monitoring.TaskMonitor; import org.apache.hadoop.hbase.procedure.MasterProcedureManagerHost; import org.apache.hadoop.hbase.procedure.flush.MasterFlushTableProcedureManager; +import org.apache.hadoop.hbase.procedure.logroll.MasterRollLogProcedureManager; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionServerInfo; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.SplitLogTask.RecoveryMode; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; @@ -436,6 +437,7 @@ public class HMaster extends HRegionServer implements MasterServices, Server { this.mpmHost = new MasterProcedureManagerHost(); this.mpmHost.register(this.snapshotManager); this.mpmHost.register(new MasterFlushTableProcedureManager()); + this.mpmHost.register(new MasterRollLogProcedureManager()); this.mpmHost.loadProcedures(conf); this.mpmHost.initialize(this, this.metricsMaster); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/RegionServerProcedureManagerHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/RegionServerProcedureManagerHost.java index 00b5100..4bc1c62 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/RegionServerProcedureManagerHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/RegionServerProcedureManagerHost.java @@ -23,6 +23,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.procedure.flush.RegionServerFlushTableProcedureManager; +import org.apache.hadoop.hbase.procedure.logroll.RegionServerRollLogProcedureManager; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.regionserver.RegionServerServices; import org.apache.hadoop.hbase.regionserver.snapshot.RegionServerSnapshotManager; @@ -73,6 +74,8 @@ public class RegionServerProcedureManagerHost extends procedures.add(new RegionServerSnapshotManager()); // load the default flush region procedure manager procedures.add(new RegionServerFlushTableProcedureManager()); + // load the default roll log region server procedure manager + procedures.add(new RegionServerRollLogProcedureManager()); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/logroll/MasterRollLogProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/logroll/MasterRollLogProcedureManager.java new file mode 100644 index 0000000..7959a0b --- /dev/null +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/logroll/MasterRollLogProcedureManager.java @@ -0,0 +1,147 @@ +/** + * 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.procedure.logroll; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ThreadPoolExecutor; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.errorhandling.ForeignException; +import org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher; +import org.apache.hadoop.hbase.master.MasterServices; +import org.apache.hadoop.hbase.master.MetricsMaster; +import org.apache.hadoop.hbase.procedure.MasterProcedureManager; +import org.apache.hadoop.hbase.procedure.Procedure; +import org.apache.hadoop.hbase.procedure.ProcedureCoordinator; +import org.apache.hadoop.hbase.procedure.ProcedureCoordinatorRpcs; +import org.apache.hadoop.hbase.procedure.ZKProcedureCoordinatorRpcs; +import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.RollWALWriterResponse; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ProcedureDescription; +import org.apache.zookeeper.KeeperException; + +import com.google.protobuf.ByteString; + +/** + * Handle the master side of the global procedure to roll HLog writers on all active + * region servers. + */ +@InterfaceAudience.Private +public class MasterRollLogProcedureManager extends MasterProcedureManager { + + private static final Log LOG = LogFactory.getLog(MasterRollLogProcedureManager.class); + + private MasterServices master; + private ProcedureCoordinator coordinator; + private boolean stopped; + private Procedure currentProc = null; + + @Override + public void stop(String why) { + LOG.info("stop: " + why); + this.stopped = true; + } + + @Override + public boolean isStopped() { + return this.stopped; + } + + @Override + public void initialize(MasterServices master, MetricsMaster metricsMaster) + throws KeeperException, IOException, UnsupportedOperationException { + this.master = master; + + // setup the default procedure coordinator + String name = master.getServerName().toString(); + ThreadPoolExecutor tpool = ProcedureCoordinator.defaultPool(name, 1); + ProcedureCoordinatorRpcs comms = new ZKProcedureCoordinatorRpcs( + master.getZooKeeper(), getProcedureSignature(), name); + + this.coordinator = new ProcedureCoordinator(comms, tpool); + } + + @Override + public String getProcedureSignature() { + return HConstants.ROLLLOG_PROCEDURE_SIGNATURE; + } + + @Override + public byte[] execProcedureWithRet(ProcedureDescription desc) throws IOException { + // start the procedure on the RS + ForeignExceptionDispatcher monitor = new ForeignExceptionDispatcher(desc.getInstance()); + List serverNames = master.getServerManager().getOnlineServersList(); + List servers = new ArrayList(); + for (ServerName sn : serverNames) { + servers.add(sn.toString()); + } + Procedure proc = coordinator.startProcedure(monitor, desc.getInstance(), new byte[0], servers); + if (proc == null) { + String msg = "Failed to submit distributed procedure for '" + + desc.getInstance() + "'"; + LOG.error(msg); + throw new IOException(msg); + } + + currentProc = proc; + HashMap returnData = new HashMap(); + + try { + // wait for the procedure to complete. A timer thread is kicked off that should cancel this + // if it takes too long. + returnData = proc.waitForCompletedWithRet(); + LOG.info("Distributed roll log procedure is successful"); + } catch (InterruptedException e) { + ForeignException ee = + new ForeignException("Interrupted while waiting for roll log procdure to finish", e); + monitor.receive(ee); + Thread.currentThread().interrupt(); + } catch (ForeignException e) { + ForeignException ee = + new ForeignException("Exception while waiting for roll log procdure to finish", e); + monitor.receive(ee); + } + monitor.rethrowException(); + + ArrayList regionsToFlush = new ArrayList(); + for (String key : returnData.keySet()) { + RollWALWriterResponse r = RollWALWriterResponse.parseFrom(returnData.get(key)); + int regionCount = r.getRegionToFlushCount(); + for (int i = 0; i < regionCount; i++) { + ByteString region = r.getRegionToFlush(i); + regionsToFlush.add(region.toByteArray()); + } + } + RollWALWriterResponse.Builder builder = RollWALWriterResponse.newBuilder(); + for (byte[] region: regionsToFlush) { + builder.addRegionToFlush(ByteString.copyFrom(region)); + } + return builder.build().toByteArray(); + } + + @Override + public boolean isProcedureDone(ProcedureDescription desc) throws IOException { + return currentProc.isCompleted(); + } + +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/logroll/RegionServerRollLogProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/logroll/RegionServerRollLogProcedureManager.java new file mode 100644 index 0000000..04db3e1 --- /dev/null +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/logroll/RegionServerRollLogProcedureManager.java @@ -0,0 +1,163 @@ +/** + * 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.procedure.logroll; + +import java.io.IOException; +import java.util.concurrent.ThreadPoolExecutor; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher; +import org.apache.hadoop.hbase.procedure.ProcedureMember; +import org.apache.hadoop.hbase.procedure.ProcedureMemberRpcs; +import org.apache.hadoop.hbase.procedure.RegionServerProcedureManager; +import org.apache.hadoop.hbase.procedure.Subprocedure; +import org.apache.hadoop.hbase.procedure.SubprocedureFactory; +import org.apache.hadoop.hbase.procedure.ZKProcedureMemberRpcs; +import org.apache.hadoop.hbase.regionserver.HRegionServer; +import org.apache.hadoop.hbase.regionserver.RegionServerServices; +import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; +import org.apache.zookeeper.KeeperException; + +/** + * This manager class handles rolling the log on a {@link HRegionServer}. + */ +@InterfaceAudience.Private +public class RegionServerRollLogProcedureManager extends RegionServerProcedureManager { + private static final Log LOG = LogFactory.getLog(RegionServerRollLogProcedureManager.class); + + public static final String ROLL_LOG_TIMEOUT_MILLIS_KEY = + "hbase.rolllog.procedure.region.timeout"; + public static final long ROLL_LOG_TIMEOUT_MILLIS_DEFAULT = 60000; + + public static final String ROLL_LOG_REQUEST_WAKE_MILLIS_KEY = + "hbase.rolllog.procedure.region.wakefrequency"; + private static final long ROLL_LOG_REQUEST_WAKE_MILLIS_DEFAULT = 500; + + private RegionServerServices rss; + private ProcedureMemberRpcs memberRpcs; + private ProcedureMember member; + + /** + * Exposed for testing. + * @param conf HBase configuration. + * @param server region server. + * @param memberRpc use specified memberRpc instance + * @param procMember use specified ProcedureMember + */ + RegionServerRollLogProcedureManager(Configuration conf, HRegionServer server, + ProcedureMemberRpcs memberRpc, ProcedureMember procMember) { + this.rss = server; + this.memberRpcs = memberRpc; + this.member = procMember; + } + + public RegionServerRollLogProcedureManager() {} + + /** + * Start accepting roll log requests. + */ + @Override + public void start() { + LOG.debug("Start region server roll log procedure manager " + rss.getServerName().toString()); + this.memberRpcs.start(rss.getServerName().toString(), member); + } + + /** + * Close this and all running tasks + * @param force forcefully stop all running tasks + * @throws IOException + */ + @Override + public void stop(boolean force) throws IOException { + String mode = force ? "abruptly" : "gracefully"; + LOG.info("Stopping region server roll log procedure manager " + mode + "."); + + try { + this.member.close(); + } finally { + this.memberRpcs.close(); + } + } + + /** + * If in a running state, creates the specified subprocedure to roll log. + * + * @return Subprocedure to submit to the ProcedureMemeber. + */ + public Subprocedure buildSubprocedure() { + + // don't run the subprocedure if the parent is stop(ping) + if (rss.isStopping() || rss.isStopped()) { + throw new IllegalStateException("Can't start roll log subprocedure on RS: " + + rss.getServerName() + ", because stopping/stopped!"); + } + + LOG.debug("Launching subprocedure to roll log"); + ForeignExceptionDispatcher exnDispatcher = new ForeignExceptionDispatcher(); + Configuration conf = rss.getConfiguration(); + long timeoutMillis = conf.getLong(ROLL_LOG_TIMEOUT_MILLIS_KEY, + ROLL_LOG_TIMEOUT_MILLIS_DEFAULT); + long wakeMillis = conf.getLong(ROLL_LOG_REQUEST_WAKE_MILLIS_KEY, + ROLL_LOG_REQUEST_WAKE_MILLIS_DEFAULT); + + // No need for a subprocedure pool/task manager since this is just a serial single task. + return new RollLogSubprocedure(rss, member, exnDispatcher, wakeMillis, timeoutMillis); + } + + public class RollLogSubprocedureBuilder implements SubprocedureFactory { + + @Override + public Subprocedure buildSubprocedure(String name, byte[] data) { + return RegionServerRollLogProcedureManager.this.buildSubprocedure(); + } + + } + + /** + * Initialize this region server roll log procedure manager + * Uses a zookeeper based member controller. + * @param rss region server + * @throws KeeperException if the zookeeper cannot be reached + */ + @Override + public void initialize(RegionServerServices rss) throws KeeperException { + this.rss = rss; + ZooKeeperWatcher zkw = rss.getZooKeeper(); + this.memberRpcs = new ZKProcedureMemberRpcs(zkw, + HConstants.ROLLLOG_PROCEDURE_SIGNATURE); + + Configuration conf = rss.getConfiguration(); + long keepAlive = conf.getLong(ROLL_LOG_TIMEOUT_MILLIS_KEY, ROLL_LOG_TIMEOUT_MILLIS_DEFAULT); + int opThreads = 1; + + // create the actual flush table procedure member + ThreadPoolExecutor pool = ProcedureMember.defaultPool(rss.getServerName().toString(), + opThreads, keepAlive); + this.member = new ProcedureMember(memberRpcs, pool, new RollLogSubprocedureBuilder()); + } + + @Override + public String getProcedureSignature() { + return HConstants.ROLLLOG_PROCEDURE_SIGNATURE; + } + +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/logroll/RollLogSubprocedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/logroll/RollLogSubprocedure.java new file mode 100644 index 0000000..c755beb --- /dev/null +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/logroll/RollLogSubprocedure.java @@ -0,0 +1,97 @@ +/** + * 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.procedure.logroll; + +import java.io.IOException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.errorhandling.ForeignException; +import org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher; +import org.apache.hadoop.hbase.procedure.ProcedureMember; +import org.apache.hadoop.hbase.procedure.Subprocedure; +import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.RollWALWriterResponse; +import org.apache.hadoop.hbase.regionserver.RegionServerServices; +import org.apache.hadoop.hbase.regionserver.wal.HLog; + +import com.google.protobuf.ByteString; + +/** + * This subprocedure implementation forces a log roll on the RS. + */ +public class RollLogSubprocedure extends Subprocedure { + private static final Log LOG = LogFactory.getLog(RollLogSubprocedure.class); + + private final RegionServerServices rss; + private HLog hlog; + + public RollLogSubprocedure(RegionServerServices rss, ProcedureMember member, + ForeignExceptionDispatcher errorListener, long wakeFrequency, long timeout) { + + super(member, HConstants.ROLLLOG_PROCEDURE_NAME, errorListener, wakeFrequency, timeout); + LOG.info("Constructing a RollLogSubprocedure."); + this.rss = rss; + } + + private byte[][] RSRollLog() throws IOException { + hlog = rss.getWAL(null); + return hlog.rollWriter(true); + } + + @Override + public void acquireBarrier() throws ForeignException { + // do nothing, executing in inside barrier step. + } + + /** + * do a log roll. + * @return regions to flush after roll log + */ + @Override + public byte[] insideBarrier() throws ForeignException { + monitor.rethrowException(); + byte[][] regionsToFlush; + try { + regionsToFlush = RSRollLog(); + } catch (IOException e) { + throw new ForeignException("Roll log task failed on region server" + + rss.getServerName().getServerName(), e); + } + RollWALWriterResponse.Builder builder = RollWALWriterResponse.newBuilder(); + if (regionsToFlush != null) { + for (byte[] region: regionsToFlush) { + builder.addRegionToFlush(ByteString.copyFrom(region)); + } + } + monitor.rethrowException(); + return builder.build().toByteArray(); + } + + /** + * Cancel threads if they haven't finished. + */ + @Override + public void cleanup(Exception e) { + } + + public void releaseBarrier() { + // NO OP + } + +} diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java index 54b751d..f4fb09e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java @@ -1589,6 +1589,30 @@ public class TestAdmin { } @Test (timeout=300000) + public void testRollAllHLogWriters() throws Exception { + setUpforLogRolling(); + String className = this.getClass().getName(); + StringBuilder v = new StringBuilder(className); + while (v.length() < 1000) { + v.append(className); + } + byte[] value = Bytes.toBytes(v.toString()); + HRegionServer regionServer = startAndWriteData("TestRollAllHLogWriters", value); + LOG.info("after writing there are " + + HLogUtilsForTests.getNumRolledLogFiles(regionServer.getWAL()) + " log files"); + + byte[][] regionsToFlush = admin.rollAllHLogWriters(); + + for(byte [] region : regionsToFlush) { + admin.flush(region); + } + int count = HLogUtilsForTests.getNumRolledLogFiles(regionServer.getWAL()); + LOG.info("after flushing all regions and rolling logs there are " + + count + " log files"); + assertTrue(("actual count: " + count), count <= 2); + } + + @Test (timeout=300000) public void testMoveToPreviouslyAssignedRS() throws IOException, InterruptedException { byte[] tableName = Bytes.toBytes("testMoveToPreviouslyAssignedRS"); MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); @@ -1613,6 +1637,7 @@ public class TestAdmin { // We roll the log after every 32 writes TEST_UTIL.getConfiguration().setInt("hbase.regionserver.maxlogentries", 32); + TEST_UTIL.getConfiguration().setInt("hbase.regionserver.maxlogs", 1); TEST_UTIL.getConfiguration().setInt( "hbase.regionserver.logroll.errors.tolerated", 2); diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb index 43ccad3..fa91a2d 100644 --- a/hbase-shell/src/main/ruby/hbase/admin.rb +++ b/hbase-shell/src/main/ruby/hbase/admin.rb @@ -82,6 +82,12 @@ module Hbase end #---------------------------------------------------------------------------------------------- + # Requests to roll all regionservers' HLog + def hlog_roll_all() + @admin.rollAllHLogWriters() + end + + #---------------------------------------------------------------------------------------------- # Requests a table or region split def split(table_or_region_name, split_point) if split_point == nil diff --git a/hbase-shell/src/main/ruby/shell.rb b/hbase-shell/src/main/ruby/shell.rb index 62e0396..96ad158 100644 --- a/hbase-shell/src/main/ruby/shell.rb +++ b/hbase-shell/src/main/ruby/shell.rb @@ -306,6 +306,7 @@ Shell.load_command_group( unassign zk_dump hlog_roll + hlog_roll_all catalogjanitor_run catalogjanitor_switch catalogjanitor_enabled diff --git a/hbase-shell/src/main/ruby/shell/commands/hlog_roll_all.rb b/hbase-shell/src/main/ruby/shell/commands/hlog_roll_all.rb new file mode 100644 index 0000000..2439230 --- /dev/null +++ b/hbase-shell/src/main/ruby/shell/commands/hlog_roll_all.rb @@ -0,0 +1,35 @@ +# +# +# 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. +# +module Shell + module Commands + class HlogRollAll < Command + def help + return <<-EOF +Roll the log writer on all active region servers. That is, start writing log messages to a new file. +EOF + end + + def command() + format_simple_command do + admin.hlog_roll_all() + end + end + end + end +end