Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mcc cdh5.10.1 #1

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,84 +15,87 @@

<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
<hadoop.version>2.6.0-cdh5.10.1</hadoop.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid duplication use the variable for CDH in this one.

<hbase.version>1.2.0-cdh5.10.1</hbase.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

<cloudera-manager.version>5.10.1</cloudera-manager.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this one to cdh.version.


</properties>

<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.5.0-cdh5.3.0</version>
<version>${hadoop.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.5.0-cdh5.3.0</version>
<version>${hadoop.version}</version>
<type>test-jar</type>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-server</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-server</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-protocol</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-hadoop2-compat</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
<!-- <scope>runtime</scope> -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment.

</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-hadoop2-compat</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
<type>test-jar</type>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-common</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-common</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
<type>test-jar</type>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-hadoop-compat</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-hadoop-compat</artifactId>
<version>0.98.6-cdh5.3.0</version>
<version>${hbase.version}</version>
<type>test-jar</type>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>com.cloudera.api</groupId>
<artifactId>cloudera-manager-api</artifactId>
<version>5.3.1</version>
<version>${cloudera-manager.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void createTableAsync(final HTableDescriptor desc,
callArray[counter++] = new Callable<Void>() {
@Override
public Void call() throws Exception {
LOG.info("createTableAsync: " + desc.getName() + " for cluster: primary");
LOG.info("createTableAsync: " + desc.getTableName() + " for cluster: primary");
HBaseAdminMultiCluster.super.createTableAsync(desc, splitKeys);
return null;
}
Expand All @@ -240,7 +240,7 @@ public Void call() throws Exception {
callArray[counter++] = new Callable<Void>() {
@Override
public Void call() throws Exception {
LOG.info("createTableAsync: " + desc.getName() + " for cluster: " + entry.getKey());
LOG.info("createTableAsync: " + desc.getTableName() + " for cluster: " + entry.getKey());
entry.getValue().createTableAsync(desc, splitKeys);
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import org.apache.hadoop.hbase.client.HTableInterface;

public interface HBaseTableFunction<T> {
public T call(HTableInterface table) throws Exception;
public T call(Table table) throws Exception;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class HConnectionManagerMultiClusterWrapper {

public static HConnection createConnection(Configuration conf)
public static Connection createConnection(Configuration conf)
throws IOException {

Logger LOG = Logger.getLogger(HConnectionManagerMultiClusterWrapper.class);
Expand All @@ -21,31 +21,31 @@ public static HConnection createConnection(Configuration conf)

if (failoverClusters.size() == 0) {
LOG.info(" -- Getting a signle cluster connection !!");
return HConnectionManager.createConnection(conf);
return ConnectionFactory.createConnection(conf);
} else {

Map<String, Configuration> configMap = HBaseMultiClusterConfigUtil
.splitMultiConfigFile(conf);

LOG.info(" -- Getting primary Connction");
HConnection primaryConnection = HConnectionManager
Connection primaryConnection = ConnectionFactory
.createConnection(configMap
.get(HBaseMultiClusterConfigUtil.PRIMARY_NAME));
LOG.info(" --- Got primary Connction");

ArrayList<HConnection> failoverConnections = new ArrayList<HConnection>();
ArrayList<Connection> failoverConnections = new ArrayList<Connection>();

for (Entry<String, Configuration> entry : configMap.entrySet()) {
if (!entry.getKey().equals(HBaseMultiClusterConfigUtil.PRIMARY_NAME)) {
LOG.info(" -- Getting failure Connction");
failoverConnections.add(HConnectionManager.createConnection(entry
failoverConnections.add(ConnectionFactory.createConnection(entry
.getValue()));
LOG.info(" --- Got failover Connction");
}
}

return new HConnectionMultiCluster(conf, primaryConnection,
failoverConnections.toArray(new HConnection[0]));
failoverConnections.toArray(new Connection[0]));
}
}
}
Loading