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;
021import org.apache.hadoop.hbase.procedure2.Procedure;
022import org.apache.yetus.audience.InterfaceAudience;
023
024/**
025 * An In-Memory store that does not keep track of the procedures inserted.
026 */
027@InterfaceAudience.Private
028public class NoopProcedureStore extends ProcedureStoreBase {
029  private int numThreads;
030
031  @Override
032  public void start(int numThreads) throws IOException {
033    if (!setRunning(true)) {
034      return;
035    }
036    this.numThreads = numThreads;
037  }
038
039  @Override
040  public void stop(boolean abort) {
041    setRunning(false);
042  }
043
044  @Override
045  public void recoverLease() throws IOException {
046    // no-op
047  }
048
049  @Override
050  public int getNumThreads() {
051    return numThreads;
052  }
053
054  @Override
055  public int setRunningProcedureCount(final int count) {
056    return count;
057  }
058
059  @Override
060  public void load(final ProcedureLoader loader) throws IOException {
061    loader.setMaxProcId(0);
062  }
063
064  @Override
065  public void insert(Procedure<?> proc, Procedure<?>[] subprocs) {
066    // no-op
067  }
068
069  @Override
070  public void insert(Procedure<?>[] proc) {
071    // no-op
072  }
073
074  @Override
075  public void update(Procedure<?> proc) {
076    // no-op
077  }
078
079  @Override
080  public void delete(long procId) {
081    // no-op
082  }
083
084  @Override
085  public void delete(Procedure<?> proc, long[] subprocs) {
086    // no-op
087  }
088
089  @Override
090  public void delete(long[] procIds, int offset, int count) {
091    // no-op
092  }
093}