Skip to content

Commit

Permalink
Revert "HBASE-19665 Add table based replication peers/queues storage …
Browse files Browse the repository at this point in the history
…back"

This reverts commit 31978c3.

 Conflicts:
	hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableReplicationStorageBase.java
  • Loading branch information
Apache9 committed Mar 17, 2018
1 parent 104f587 commit 00095a2
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 1,019 deletions.
Expand Up @@ -42,8 +42,7 @@ void addPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled)

/**
* Set the state of peer, {@code true} to {@code ENABLED}, otherwise to {@code DISABLED}.
* @throws ReplicationException if there are errors accessing the storage service or peer does not
* exist.
* @throws ReplicationException if there are errors accessing the storage service.
*/
void setPeerState(String peerId, boolean enabled) throws ReplicationException;

Expand Down
Expand Up @@ -18,7 +18,6 @@
package org.apache.hadoop.hbase.replication;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.util.ReflectionUtils;
import org.apache.hadoop.hbase.zookeeper.ZKWatcher;
import org.apache.yetus.audience.InterfaceAudience;

Expand All @@ -30,36 +29,21 @@
@InterfaceAudience.Private
public final class ReplicationStorageFactory {

public static final String REPLICATION_PEER_STORAGE_IMPL = "hbase.replication.peer.storage.impl";
public static final String DEFAULT_REPLICATION_PEER_STORAGE_IMPL =
ZKReplicationPeerStorage.class.getName();

public static final String REPLICATION_QUEUE_STORAGE_IMPL =
"hbase.replication.queue.storage.impl";
public static final String DEFAULT_REPLICATION_QUEUE_STORAGE_IMPL =
ZKReplicationQueueStorage.class.getName();

private ReplicationStorageFactory() {
}

/**
* Create a new {@link ReplicationPeerStorage}.
*/
public static ReplicationPeerStorage getReplicationPeerStorage(ZKWatcher zk, Configuration conf) {
String peerStorageClass =
conf.get(REPLICATION_PEER_STORAGE_IMPL, DEFAULT_REPLICATION_PEER_STORAGE_IMPL);
return ReflectionUtils.instantiateWithCustomCtor(peerStorageClass,
new Class[] { ZKWatcher.class, Configuration.class }, new Object[] { zk, conf });
return new ZKReplicationPeerStorage(zk, conf);
}

/**
* Create a new {@link ReplicationQueueStorage}.
*/
public static ReplicationQueueStorage getReplicationQueueStorage(ZKWatcher zk,
Configuration conf) {
String queueStorageClass =
conf.get(REPLICATION_QUEUE_STORAGE_IMPL, DEFAULT_REPLICATION_QUEUE_STORAGE_IMPL);
return ReflectionUtils.instantiateWithCustomCtor(queueStorageClass,
new Class[] { ZKWatcher.class, Configuration.class }, new Object[] { zk, conf });
return new ZKReplicationQueueStorage(zk, conf);
}
}
Expand Up @@ -17,8 +17,6 @@
*/
package org.apache.hadoop.hbase.replication;

import static org.apache.hadoop.hbase.replication.ZKReplicationStorageBase.toByteArray;

import java.io.IOException;
import java.util.Collection;
import java.util.List;
Expand All @@ -32,19 +30,12 @@
import org.apache.hadoop.hbase.TableName;
import org.apache.yetus.audience.InterfaceAudience;

import org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos;

/**
* Helper class for replication.
*/
@InterfaceAudience.Private
public final class ReplicationUtils {

public static final byte[] PEER_STATE_ENABLED_BYTES =
toByteArray(ReplicationProtos.ReplicationState.State.ENABLED);
public static final byte[] PEER_STATE_DISABLED_BYTES =
toByteArray(ReplicationProtos.ReplicationState.State.DISABLED);

private ReplicationUtils() {
}

Expand Down Expand Up @@ -182,8 +173,4 @@ public static boolean contains(ReplicationPeerConfig peerConfig, TableName table
return tableCFs != null && tableCFs.containsKey(tableName);
}
}

public static String parsePeerIdFromQueueId(String queueId) {
return new ReplicationQueueInfo(queueId).getPeerId();
}
}

This file was deleted.

0 comments on commit 00095a2

Please sign in to comment.