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.replication.regionserver;
019
020import java.util.Collections;
021import java.util.List;
022import java.util.Map;
023import java.util.Set;
024import java.util.SortedSet;
025import org.apache.hadoop.fs.Path;
026import org.apache.hadoop.hbase.ServerName;
027import org.apache.hadoop.hbase.replication.ReplicationException;
028import org.apache.hadoop.hbase.replication.ReplicationQueueStorage;
029import org.apache.hadoop.hbase.util.Pair;
030import org.apache.yetus.audience.InterfaceAudience;
031
032/**
033 * Noop queue storage -- does nothing.
034 */
035@InterfaceAudience.Private
036class NoopReplicationQueueStorage implements ReplicationQueueStorage {
037  NoopReplicationQueueStorage() {
038  }
039
040  @Override
041  public void removeQueue(ServerName serverName, String queueId) throws ReplicationException {
042  }
043
044  @Override
045  public void addWAL(ServerName serverName, String queueId, String fileName)
046    throws ReplicationException {
047  }
048
049  @Override
050  public void removeWAL(ServerName serverName, String queueId, String fileName)
051    throws ReplicationException {
052  }
053
054  @Override
055  public void setWALPosition(ServerName serverName, String queueId, String fileName, long position,
056    Map<String, Long> lastSeqIds) throws ReplicationException {
057  }
058
059  @Override
060  public long getLastSequenceId(String encodedRegionName, String peerId)
061    throws ReplicationException {
062    return 0;
063  }
064
065  @Override
066  public void setLastSequenceIds(String peerId, Map<String, Long> lastSeqIds)
067    throws ReplicationException {
068  }
069
070  @Override
071  public void removeLastSequenceIds(String peerId) throws ReplicationException {
072  }
073
074  @Override
075  public void removeLastSequenceIds(String peerId, List<String> encodedRegionNames)
076    throws ReplicationException {
077  }
078
079  @Override
080  public long getWALPosition(ServerName serverName, String queueId, String fileName)
081    throws ReplicationException {
082    return 0;
083  }
084
085  @Override
086  public List<String> getWALsInQueue(ServerName serverName, String queueId)
087    throws ReplicationException {
088    return Collections.EMPTY_LIST;
089  }
090
091  @Override
092  public List<String> getAllQueues(ServerName serverName) throws ReplicationException {
093    return Collections.EMPTY_LIST;
094  }
095
096  @Override
097  public Pair<String, SortedSet<String>> claimQueue(ServerName sourceServerName, String queueId,
098    ServerName destServerName) throws ReplicationException {
099    return null;
100  }
101
102  @Override
103  public void removeReplicatorIfQueueIsEmpty(ServerName serverName) throws ReplicationException {
104  }
105
106  @Override
107  public List<ServerName> getListOfReplicators() throws ReplicationException {
108    return Collections.EMPTY_LIST;
109  }
110
111  @Override
112  public Set<String> getAllWALs() throws ReplicationException {
113    return Collections.EMPTY_SET;
114  }
115
116  @Override
117  public void addPeerToHFileRefs(String peerId) throws ReplicationException {
118  }
119
120  @Override
121  public void removePeerFromHFileRefs(String peerId) throws ReplicationException {
122  }
123
124  @Override
125  public void addHFileRefs(String peerId, List<Pair<Path, Path>> pairs)
126    throws ReplicationException {
127  }
128
129  @Override
130  public void removeHFileRefs(String peerId, List<String> files) throws ReplicationException {
131  }
132
133  @Override
134  public List<String> getAllPeersFromHFileRefsQueue() throws ReplicationException {
135    return Collections.EMPTY_LIST;
136  }
137
138  @Override
139  public List<String> getReplicableHFiles(String peerId) throws ReplicationException {
140    return Collections.EMPTY_LIST;
141  }
142
143  @Override
144  public Set<String> getAllHFileRefs() throws ReplicationException {
145    return Collections.EMPTY_SET;
146  }
147
148  @Override
149  public String getRsNode(ServerName serverName) {
150    return null;
151  }
152}