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 @Override 040 public void removeQueue(ServerName serverName, String queueId) throws ReplicationException {} 041 042 @Override 043 public void addWAL(ServerName serverName, String queueId, String fileName) 044 throws ReplicationException {} 045 046 @Override 047 public void removeWAL(ServerName serverName, String queueId, String fileName) 048 throws ReplicationException { } 049 050 @Override 051 public void setWALPosition(ServerName serverName, String queueId, String fileName, long position, 052 Map<String, Long> lastSeqIds) throws ReplicationException {} 053 054 @Override 055 public long getLastSequenceId(String encodedRegionName, String peerId) 056 throws ReplicationException { 057 return 0; 058 } 059 060 @Override 061 public void setLastSequenceIds(String peerId, Map<String, Long> lastSeqIds) 062 throws ReplicationException {} 063 064 @Override 065 public void removeLastSequenceIds(String peerId) throws ReplicationException {} 066 067 @Override 068 public void removeLastSequenceIds(String peerId, List<String> encodedRegionNames) 069 throws ReplicationException {} 070 071 @Override 072 public long getWALPosition(ServerName serverName, String queueId, String fileName) 073 throws ReplicationException { 074 return 0; 075 } 076 077 @Override 078 public List<String> getWALsInQueue(ServerName serverName, String queueId) 079 throws ReplicationException { 080 return Collections.EMPTY_LIST; 081 } 082 083 @Override 084 public List<String> getAllQueues(ServerName serverName) throws ReplicationException { 085 return Collections.EMPTY_LIST; 086 } 087 088 @Override 089 public Pair<String, SortedSet<String>> claimQueue(ServerName sourceServerName, String queueId, 090 ServerName destServerName) throws ReplicationException { 091 return null; 092 } 093 094 @Override 095 public void removeReplicatorIfQueueIsEmpty(ServerName serverName) 096 throws ReplicationException {} 097 098 @Override 099 public List<ServerName> getListOfReplicators() throws ReplicationException { 100 return Collections.EMPTY_LIST; 101 } 102 103 @Override 104 public Set<String> getAllWALs() throws ReplicationException { 105 return Collections.EMPTY_SET; 106 } 107 108 @Override 109 public void addPeerToHFileRefs(String peerId) throws ReplicationException {} 110 111 @Override 112 public void removePeerFromHFileRefs(String peerId) throws ReplicationException {} 113 114 @Override 115 public void addHFileRefs(String peerId, List<Pair<Path, Path>> pairs) 116 throws ReplicationException {} 117 118 @Override 119 public void removeHFileRefs(String peerId, List<String> files) throws ReplicationException {} 120 121 @Override 122 public List<String> getAllPeersFromHFileRefsQueue() throws ReplicationException { 123 return Collections.EMPTY_LIST; 124 } 125 126 @Override 127 public List<String> getReplicableHFiles(String peerId) throws ReplicationException { 128 return Collections.EMPTY_LIST; 129 } 130 131 @Override 132 public Set<String> getAllHFileRefs() throws ReplicationException { 133 return Collections.EMPTY_SET; 134 } 135 136 @Override 137 public String getRsNode(ServerName serverName) { 138 return null; 139 } 140}