001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.procedure2.store;
019
020import java.io.IOException;
021
022import org.apache.hadoop.hbase.procedure2.Procedure;
023import org.apache.yetus.audience.InterfaceAudience;
024
025/**
026 * An In-Memory store that does not keep track of the procedures inserted.
027 */
028@InterfaceAudience.Private
029public class NoopProcedureStore extends ProcedureStoreBase {
030  private int numThreads;
031
032  @Override
033  public void start(int numThreads) throws IOException {
034    if (!setRunning(true)) {
035      return;
036    }
037    this.numThreads = numThreads;
038  }
039
040  @Override
041  public void stop(boolean abort) {
042    setRunning(false);
043  }
044
045  @Override
046  public void recoverLease() throws IOException {
047    // no-op
048  }
049
050  @Override
051  public int getNumThreads() {
052    return numThreads;
053  }
054
055  @Override
056  public int setRunningProcedureCount(final int count) {
057    return count;
058  }
059
060  @Override
061  public void load(final ProcedureLoader loader) throws IOException {
062    loader.setMaxProcId(0);
063  }
064
065  @Override
066  public void insert(Procedure<?> proc, Procedure<?>[] subprocs) {
067    // no-op
068  }
069
070  @Override
071  public void insert(Procedure<?>[] proc) {
072    // no-op
073  }
074
075  @Override
076  public void update(Procedure<?> proc) {
077    // no-op
078  }
079
080  @Override
081  public void delete(long procId) {
082    // no-op
083  }
084
085  @Override
086  public void delete(Procedure<?> proc, long[] subprocs) {
087    // no-op
088  }
089
090  @Override
091  public void delete(long[] procIds, int offset, int count) {
092    // no-op
093  }
094}