Merge pull request #1692 from minwoo-jung/naver-693

[#1613] remove dependency for spring-data-hadoop-hbase
This commit is contained in:
Minwoo Jung
2016-04-15 15:45:57 +09:00
5 changed files with 91 additions and 89 deletions
@@ -14,7 +14,7 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd">
<bean id="hbaseConfiguration" class="org.springframework.data.hadoop.hbase.HbaseConfigurationFactoryBean">
<bean id="hbaseConfiguration" class="com.navercorp.pinpoint.common.hbase.HbaseConfigurationFactoryBean">
<property name="properties">
<props>
<prop key="hbase.zookeeper.quorum">${hbase.client.host}</prop>
@@ -39,7 +39,6 @@
<prop key="hbase.client.max.retries.in.queue">${hbase.client.async.max.retries.in.queue}</prop>
</props>
</property>
<property name="deleteConnection" value="false"/>
</bean>
<bean id="connectionFactory" class="com.navercorp.pinpoint.common.hbase.PooledHTableFactory">
-79
View File
@@ -160,85 +160,6 @@
<artifactId>spring-tx</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-hadoop-hbase</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-hadoop-pig</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-hadoop-batch</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-hadoop-hive</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-distcp</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-shuffle</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-jobclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-streaming</artifactId>
</exclusion>
<exclusion>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--jackson jsonMapper. hbase need that for now -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
@@ -0,0 +1,89 @@
/*
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.navercorp.pinpoint.common.hbase;
import java.util.Enumeration;
import java.util.Properties;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
/**
* Factory for creating HBase specific configuration. By default cleans up any connection associated with the current configuration.
*
* @author Costin Leau
*/
public class HbaseConfigurationFactoryBean implements InitializingBean, FactoryBean<Configuration> {
private Configuration configuration;
private Configuration hadoopConfig;
private Properties properties;
/**
* Sets the Hadoop configuration to use.
*
* @param configuration The configuration to set.
*/
public void setConfiguration(Configuration configuration) {
this.hadoopConfig = configuration;
}
/**
* Sets the configuration properties.
*
* @param properties The properties to set.
*/
public void setProperties(Properties properties) {
this.properties = properties;
}
public void afterPropertiesSet() {
configuration = (hadoopConfig != null ? HBaseConfiguration.create(hadoopConfig) : HBaseConfiguration.create());
addProperties(configuration, properties);
}
/**
* Adds the specified properties to the given {@link Configuration} object.
*
* @param configuration configuration to manipulate. Should not be null.
* @param properties properties to add to the configuration. May be null.
*/
private void addProperties(Configuration configuration, Properties properties) {
Assert.notNull(configuration, "A non-null configuration is required");
if (properties != null) {
Enumeration<?> props = properties.propertyNames();
while (props.hasMoreElements()) {
String key = props.nextElement().toString();
configuration.set(key, properties.getProperty(key));
}
}
}
public Configuration getObject() {
return configuration;
}
public Class<? extends Configuration> getObjectType() {
return (configuration != null ? configuration.getClass() : Configuration.class);
}
public boolean isSingleton() {
return true;
}
}
-6
View File
@@ -345,12 +345,6 @@
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-hadoop-hbase</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="hbaseConfiguration" class="org.springframework.data.hadoop.hbase.HbaseConfigurationFactoryBean">
<bean id="hbaseConfiguration" class="com.navercorp.pinpoint.common.hbase.HbaseConfigurationFactoryBean">
<property name="properties">
<props>
<prop key="hbase.zookeeper.quorum">${hbase.client.host}</prop>
@@ -22,7 +22,6 @@
<prop key="hbase.ipc.client.socket.timeout.write">${hbase.ipc.client.socket.timeout.write}</prop>
</props>
</property>
<property name="deleteConnection" value="false"/>
</bean>
<bean id="connectionFactory" class="com.navercorp.pinpoint.common.hbase.PooledHTableFactory">