Merge pull request #226 from podorvanova/revert-gora-271-changes
GORA-667 Revert GORA-271 changes in hbase-store
diff --git a/.github/workflows/master-pr-build.yml b/.github/workflows/master-pr-build.yml
index 590833f..5d2a207 100644
--- a/.github/workflows/master-pr-build.yml
+++ b/.github/workflows/master-pr-build.yml
@@ -34,4 +34,4 @@
with:
java-version: ${{ matrix.java }}
- name: mvn sourcecheck
- run: mvn clean install
\ No newline at end of file
+ run: mvn --no-transfer-progress --batch-mode clean install
\ No newline at end of file
diff --git a/.github/workflows/master-push-build.yml b/.github/workflows/master-push-build.yml
index 29d5746..3e3c627 100644
--- a/.github/workflows/master-push-build.yml
+++ b/.github/workflows/master-push-build.yml
@@ -34,4 +34,4 @@
with:
java-version: ${{ matrix.java }}
- name: mvn sourcecheck
- run: mvn clean install
\ No newline at end of file
+ run: mvn --no-transfer-progress --batch-mode clean install
\ No newline at end of file
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..b3eebee
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,94 @@
+#!groovy
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+def AGENT_LABEL = env.AGENT_LABEL ?: 'ubuntu'
+def JDK_NAME = env.JDK_NAME ?: 'jdk_1.8_latest'
+def MVN_NAME = env.MVN_NAME ?: 'maven_3_latest'
+
+// =================================================================
+// https://cwiki.apache.org/confluence/display/INFRA/Jenkins
+// https://cwiki.apache.org/confluence/display/INFRA/Multibranch+Pipeline+recipes
+// =================================================================
+
+// general pipeline documentation: https://jenkins.io/doc/book/pipeline/syntax/
+pipeline {
+
+ // https://jenkins.io/doc/book/pipeline/syntax/#agent
+ agent {
+ node {
+ label AGENT_LABEL
+ }
+ }
+
+ tools {
+ maven MVN_NAME
+ jdk JDK_NAME
+ }
+
+ // https://jenkins.io/doc/book/pipeline/syntax/#options
+ options {
+ // support ANSI colors in stdout/stderr
+ ansiColor 'xterm'
+ // only keep the latest 10 builds
+ buildDiscarder logRotator(numToKeepStr: '10')
+ // cancel build if not complete within two hours of scheduling
+ timeout time: 2, unit: 'HOURS'
+ disableConcurrentBuilds()
+ }
+
+ environment {
+ LANG = 'C.UTF-8'
+ // --batch-mode Run in non-interactive (batch) mode
+ // --error Produce execution error messages
+ // --fail-at-end Only fail the build afterwards; allow all non-impacted builds to continue
+ // --show-version Display version information WITHOUT stopping build
+ // --no-transfer-progress Do not display transfer progress when downloading or uploading
+ MAVEN_CLI_OPTS = "--batch-mode --errors --fail-at-end --show-version --no-transfer-progress"
+ }
+
+ stages {
+ stage('Build') {
+ steps {
+ sh "mvn $MAVEN_CLI_OPTS -DskipTests clean install"
+ }
+
+ post {
+ success {
+ archiveArtifacts '**/target/*.jar'
+ }
+ }
+ }
+
+ stage('Test') {
+ steps {
+ warnError(message: "Failure during tests execution") {
+ sh "mvn $MAVEN_CLI_OPTS verify"
+ }
+ }
+
+ post {
+ always {
+ junit '**/target/surefire-reports/TEST-*.xml'
+ }
+ }
+ }
+ }
+}
diff --git a/gora-aerospike/pom.xml b/gora-aerospike/pom.xml
index e2a734e..cf61899 100644
--- a/gora-aerospike/pom.xml
+++ b/gora-aerospike/pom.xml
@@ -54,24 +54,6 @@
<osgi.export>org.apache.gora.aerospike*;version="${project.version}";-noimport:=true</osgi.export>
</properties>
- <profiles>
- <profile>
- <id>aerospike-with-test</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.2</version>
- <configuration>
- <skipTests>false</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
<build>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
@@ -89,14 +71,6 @@
</testResources>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.2</version>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
diff --git a/gora-aerospike/src/test/java/org/apache/gora/aerospike/GoraAerospikeTestDriver.java b/gora-aerospike/src/test/java/org/apache/gora/aerospike/GoraAerospikeTestDriver.java
index cc11347..9c8a369 100644
--- a/gora-aerospike/src/test/java/org/apache/gora/aerospike/GoraAerospikeTestDriver.java
+++ b/gora-aerospike/src/test/java/org/apache/gora/aerospike/GoraAerospikeTestDriver.java
@@ -45,7 +45,7 @@
@Override
public void setUpClass() throws Exception {
log.info("Setting up Aerospike test driver");
- conf.set("gora.aerospikestore.server.ip", "localhost");
+ conf.set("gora.aerospikestore.server.ip", aerospikeContainer.getContainerIpAddress());
conf.set("gora.aerospikestore.server.port", aerospikeContainer.getMappedPort(3000).toString());
}
diff --git a/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreCountQuery.java b/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreCountQuery.java
index f710f07..72a2ba5 100644
--- a/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreCountQuery.java
+++ b/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreCountQuery.java
@@ -49,7 +49,7 @@
@Before
public void setUp() throws Exception {
- conf.set("gora.aerospikestore.server.ip", "localhost");
+ conf.set("gora.aerospikestore.server.ip", aerospikeContainer.getContainerIpAddress());
conf.set("gora.aerospikestore.server.port", aerospikeContainer.getMappedPort(3000).toString());
webPageStore = DataStoreFactory
diff --git a/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreMapReduceSerialization.java b/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreMapReduceSerialization.java
index a2cc51c..b8f281e 100644
--- a/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreMapReduceSerialization.java
+++ b/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreMapReduceSerialization.java
@@ -50,7 +50,7 @@
@Before
public void setUp() throws Exception {
- conf.set("gora.aerospikestore.server.ip", "localhost");
+ conf.set("gora.aerospikestore.server.ip", aerospikeContainer.getContainerIpAddress());
conf.set("gora.aerospikestore.server.port", aerospikeContainer.getMappedPort(3000).toString());
webPageStore = DataStoreFactory
diff --git a/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreWordCount.java b/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreWordCount.java
index 8d9d7e9..5e31f56 100644
--- a/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreWordCount.java
+++ b/gora-aerospike/src/test/java/org/apache/gora/aerospike/mapreduce/TestAerospikeStoreWordCount.java
@@ -52,7 +52,7 @@
@Before
public void setUp() throws Exception {
- conf.set("gora.aerospikestore.server.ip", "localhost");
+ conf.set("gora.aerospikestore.server.ip", aerospikeContainer.getContainerIpAddress());
conf.set("gora.aerospikestore.server.port", aerospikeContainer.getMappedPort(3000).toString());
webPageStore = DataStoreFactory
diff --git a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
index aeda495..f0cb738 100644
--- a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
+++ b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java
@@ -30,7 +30,6 @@
import com.datastax.driver.core.policies.ConstantReconnectionPolicy;
import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy;
import com.datastax.driver.core.policies.DefaultRetryPolicy;
-import com.datastax.driver.core.policies.DowngradingConsistencyRetryPolicy;
import com.datastax.driver.core.policies.ExponentialReconnectionPolicy;
import com.datastax.driver.core.policies.FallthroughRetryPolicy;
import com.datastax.driver.core.policies.LatencyAwarePolicy;
@@ -276,24 +275,12 @@
break;
case "DCAwareRoundRobinPolicy": {
String dataCenter = properties.getProperty(CassandraStoreParameters.DATA_CENTER);
- boolean allowRemoteDCsForLocalConsistencyLevel = Boolean.parseBoolean(
- properties.getProperty(CassandraStoreParameters.ALLOW_REMOTE_DCS_FOR_LOCAL_CONSISTENCY_LEVEL));
if (dataCenter != null && !dataCenter.isEmpty()) {
- if (allowRemoteDCsForLocalConsistencyLevel) {
- builder = builder.withLoadBalancingPolicy(
- DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter)
- .allowRemoteDCsForLocalConsistencyLevel().build());
- } else {
- builder = builder.withLoadBalancingPolicy(
- DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter).build());
- }
+ builder = builder.withLoadBalancingPolicy(
+ DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter).build());
} else {
- if (allowRemoteDCsForLocalConsistencyLevel) {
- builder = builder.withLoadBalancingPolicy(
- (DCAwareRoundRobinPolicy.builder().allowRemoteDCsForLocalConsistencyLevel().build()));
- } else {
- builder = builder.withLoadBalancingPolicy((DCAwareRoundRobinPolicy.builder().build()));
- }
+ builder = builder.withLoadBalancingPolicy(
+ (DCAwareRoundRobinPolicy.builder().build()));
}
break;
}
@@ -302,25 +289,12 @@
break;
case "TokenAwareDCAwareRoundRobinPolicy": {
String dataCenter = properties.getProperty(CassandraStoreParameters.DATA_CENTER);
- boolean allowRemoteDCsForLocalConsistencyLevel = Boolean.parseBoolean(
- properties.getProperty(CassandraStoreParameters.ALLOW_REMOTE_DCS_FOR_LOCAL_CONSISTENCY_LEVEL));
if (dataCenter != null && !dataCenter.isEmpty()) {
- if (allowRemoteDCsForLocalConsistencyLevel) {
- builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy(
- DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter)
- .allowRemoteDCsForLocalConsistencyLevel().build()));
- } else {
- builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy(
- DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter).build()));
- }
+ builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy(
+ DCAwareRoundRobinPolicy.builder().withLocalDc(dataCenter).build()));
} else {
- if (allowRemoteDCsForLocalConsistencyLevel) {
- builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy(
- DCAwareRoundRobinPolicy.builder().allowRemoteDCsForLocalConsistencyLevel().build()));
- } else {
- builder = builder.withLoadBalancingPolicy(
- new TokenAwarePolicy(DCAwareRoundRobinPolicy.builder().build()));
- }
+ builder = builder.withLoadBalancingPolicy(new TokenAwarePolicy(
+ DCAwareRoundRobinPolicy.builder().build()));
}
break;
}
@@ -429,18 +403,12 @@
case "DefaultRetryPolicy":
builder = builder.withRetryPolicy(DefaultRetryPolicy.INSTANCE);
break;
- case "DowngradingConsistencyRetryPolicy":
- builder = builder.withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE);
- break;
case "FallthroughRetryPolicy":
builder = builder.withRetryPolicy(FallthroughRetryPolicy.INSTANCE);
break;
case "LoggingDefaultRetryPolicy":
builder = builder.withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE));
break;
- case "LoggingDowngradingConsistencyRetryPolicy":
- builder = builder.withRetryPolicy(new LoggingRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE));
- break;
case "LoggingFallthroughRetryPolicy":
builder = builder.withRetryPolicy(new LoggingRetryPolicy(FallthroughRetryPolicy.INSTANCE));
break;
diff --git a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStoreParameters.java b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStoreParameters.java
index 7032dab..5d453fe 100644
--- a/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStoreParameters.java
+++ b/gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraStoreParameters.java
@@ -154,8 +154,8 @@
public static final String EXPONENTIAL_RECONNECTION_POLICY_MAX_DELAY = "gora.cassandrastore.exponentialReconnectionPolicyMaxDelay";
/**
* Property pointing to set the retry policy.
- * "DefaultRetryPolicy", "DowngradingConsistencyRetryPolicy", "FallthroughRetryPolicy",
- * "LoggingDefaultRetryPolicy", "LoggingDowngradingConsistencyRetryPolicy", "LoggingFallthroughRetryPolicy"
+ * "DefaultRetryPolicy", "FallthroughRetryPolicy",
+ * "LoggingDefaultRetryPolicy", "LoggingFallthroughRetryPolicy"
*/
public static final String RETRY_POLICY = "gora.cassandrastore.retryPolicy";
/**
@@ -209,11 +209,6 @@
*/
public static final String DATA_CENTER = "gora.cassandrastore.dataCenter";
/**
- * Property pointing to enable/disable remote data centers for local consistency level.
- * string
- */
- public static final String ALLOW_REMOTE_DCS_FOR_LOCAL_CONSISTENCY_LEVEL = "gora.cassandrastore.allowRemoteDCsForLocalConsistencyLevel";
- /**
* Property pointing to use Native Cassandra Native Serialization.
* avro/ native
*/
diff --git a/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java b/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java
index 9aeba68..363767e 100644
--- a/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java
+++ b/gora-compiler/src/main/java/org/apache/gora/compiler/GoraCompiler.java
@@ -30,6 +30,7 @@
import java.util.Map;
import java.util.Set;
+import org.apache.avro.JsonProperties;
import org.apache.avro.Schema;
import org.apache.avro.Schema.Field;
import org.apache.avro.Schema.Type;
@@ -350,18 +351,16 @@
List<Field> newFields = new ArrayList<>();
byte[] defaultDirtyBytesValue = new byte[getNumberOfBytesNeededForDirtyBits(originalSchema)];
Arrays.fill(defaultDirtyBytesValue, (byte) 0);
- JsonNode defaultDirtyJsonValue = JsonNodeFactory.instance
- .binaryNode(defaultDirtyBytesValue);
Field dirtyBits = new Field(DIRTY_BYTES_FIELD_NAME,
Schema.create(Type.BYTES),
"Bytes used to represent weather or not a field is dirty.",
- defaultDirtyJsonValue);
+ defaultDirtyBytesValue);
newFields.add(dirtyBits);
for (Field originalField : originalFields) {
// recursively add dirty support
Field newField = new Field(originalField.name(),
getSchemaWithDirtySupport(originalField.schema(),queue),
- originalField.doc(), originalField.defaultValue(),
+ originalField.doc(), originalField.defaultVal(),
originalField.order());
newFields.add(newField);
}
diff --git a/gora-couchdb/pom.xml b/gora-couchdb/pom.xml
index 24f5355..4ff0b93 100644
--- a/gora-couchdb/pom.xml
+++ b/gora-couchdb/pom.xml
@@ -71,11 +71,6 @@
</testResources>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.2</version>
- </plugin>
- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
diff --git a/gora-couchdb/src/main/java/org/apache/gora/couchdb/store/CouchDBStore.java b/gora-couchdb/src/main/java/org/apache/gora/couchdb/store/CouchDBStore.java
index a81a0ab..5207855 100644
--- a/gora-couchdb/src/main/java/org/apache/gora/couchdb/store/CouchDBStore.java
+++ b/gora-couchdb/src/main/java/org/apache/gora/couchdb/store/CouchDBStore.java
@@ -138,7 +138,7 @@
mapping = builder.build();
final ObjectMapperFactory myObjectMapperFactory = new CouchDBObjectMapperFactory();
- myObjectMapperFactory.createObjectMapper().addMixInAnnotations(persistentClass, CouchDbDocument.class);
+ myObjectMapperFactory.createObjectMapper().addMixIn(persistentClass, CouchDbDocument.class);
db = new StdCouchDbConnector(mapping.getDatabaseName(), dbInstance, myObjectMapperFactory);
db.createDatabaseIfNotExists();
diff --git a/gora-couchdb/src/test/java/org/apache/gora/couchdb/GoraCouchDBTestDriver.java b/gora-couchdb/src/test/java/org/apache/gora/couchdb/GoraCouchDBTestDriver.java
index 7996708..9b9b20a 100644
--- a/gora-couchdb/src/test/java/org/apache/gora/couchdb/GoraCouchDBTestDriver.java
+++ b/gora-couchdb/src/test/java/org/apache/gora/couchdb/GoraCouchDBTestDriver.java
@@ -53,6 +53,7 @@
@Override
public void setUpClass() {
log.info("Setting up CouchDB Test Driver");
+ properties.put(CouchDBParameters.PROP_COUCHDB_SERVER, couchdbContainer.getContainerIpAddress());
properties.put(CouchDBParameters.PROP_COUCHDB_PORT, couchdbContainer.getMappedPort(5984).toString());
}
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/Generator.java b/gora-goraci/src/main/java/org/apache/gora/goraci/Generator.java
index c13f4c9..bb9935c 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/Generator.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/Generator.java
@@ -318,9 +318,9 @@
public int run(int numMappers, long numNodes, boolean concurrent) throws Exception {
LOG.info("Running Generator with numMappers={}, numNodes={}", numMappers, numNodes);
-
- Job job = new Job(getConf());
-
+
+ Job job = Job.getInstance(getConf());
+
job.setJobName("Link Generator");
job.setNumReduceTasks(0);
job.setJarByClass(getClass());
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/Verify.java b/gora-goraci/src/main/java/org/apache/gora/goraci/Verify.java
index b922411..8a68767 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/Verify.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/Verify.java
@@ -196,7 +196,7 @@
DataStore<Long,CINode> store = DataStoreFactory.getDataStore(Long.class, CINode.class, new Configuration());
- job = new Job(getConf());
+ job = Job.getInstance(getConf());
if (!job.getConfiguration().get("io.serializations").contains("org.apache.hadoop.io.serializer.JavaSerialization")) {
job.getConfiguration().set("io.serializations", job.getConfiguration().get("io.serializations") + ",org.apache.hadoop.io.serializer.JavaSerialization");
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/chef/ChefSoftwareProvisioning.java b/gora-goraci/src/main/java/org/apache/gora/goraci/chef/ChefSoftwareProvisioning.java
index 0e548e3..e4562ca 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/chef/ChefSoftwareProvisioning.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/chef/ChefSoftwareProvisioning.java
@@ -31,7 +31,8 @@
import org.apache.gora.memory.store.MemStore;
import org.apache.gora.store.DataStoreFactory;
import org.jclouds.ContextBuilder;
-import org.jclouds.chef.ChefContext;
+import org.jclouds.chef.ChefApi;
+import org.jclouds.chef.ChefApiMetadata;
import org.jclouds.chef.config.ChefProperties;
import org.jclouds.chef.domain.BootstrapConfig;
import org.jclouds.chef.domain.CookbookVersion;
@@ -106,11 +107,11 @@
chefConfig.put(ChefProperties.CHEF_VALIDATOR_CREDENTIAL, validatorCredential);
// Create the connection to the Chef server
- ChefContext chefContext = ContextBuilder.newBuilder("chef")
+ ChefApi chefApi = ContextBuilder.newBuilder(new ChefApiMetadata())
.endpoint("https://api.opscode.com/organizations/" + organization)
.credentials(client, credential)
.overrides(chefConfig)
- .buildView(ChefContext.class);
+ .buildApi(ChefApi.class);
// Create the connection to the compute provider. Note that ssh will be used to bootstrap chef
ComputeServiceContext computeContext = ContextBuilder.newBuilder(rsContinent)
@@ -129,7 +130,7 @@
// Check to see if the recipe you want exists
List<String> runlist = null;
Iterable< ? extends CookbookVersion> cookbookVersions =
- chefContext.getChefService().listCookbookVersions();
+ chefApi.chefService().listCookbookVersions();
if (any(cookbookVersions, CookbookVersionPredicates.containsRecipe(recipe))) {
runlist = new RunListBuilder().addRecipe(recipe).build();
}
@@ -141,10 +142,10 @@
// Update the chef service with the run list you wish to apply to all nodes in the group
// and also provide the json configuration used to customize the desired values
BootstrapConfig config = BootstrapConfig.builder().runList(runlist).attributes(attributes).build();
- chefContext.getChefService().updateBootstrapConfigForGroup(group, config);
+ chefApi.chefService().updateBootstrapConfigForGroup(group, config);
// Build the script that will bootstrap the node
- Statement bootstrap = chefContext.getChefService().createBootstrapScriptForGroup(group);
+ Statement bootstrap = chefApi.chefService().createBootstrapScriptForGroup(group);
TemplateBuilder templateBuilder = computeContext.getComputeService().templateBuilder();
templateBuilder.options(runScript(bootstrap));
@@ -161,7 +162,7 @@
}
// Release resources
- chefContext.close();
+ chefApi.close();
computeContext.close();
}
diff --git a/gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java b/gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java
index f02e061..f66a58e 100644
--- a/gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java
+++ b/gora-goraci/src/main/java/org/apache/gora/goraci/rackspace/RackspaceOrchestration.java
@@ -26,7 +26,6 @@
import org.apache.gora.memory.store.MemStore;
import org.apache.gora.store.DataStoreFactory;
import org.jclouds.ContextBuilder;
-import org.jclouds.chef.ChefContext;
import org.jclouds.chef.config.ChefProperties;
import org.jclouds.chef.domain.BootstrapConfig;
import org.jclouds.chef.domain.CookbookVersion;
diff --git a/gora-infinispan/src/test/java/org/apache/gora/infinispan/SimulationDriver.java b/gora-infinispan/src/test/java/org/apache/gora/infinispan/SimulationDriver.java
index 4bde737..c3f44ad 100644
--- a/gora-infinispan/src/test/java/org/apache/gora/infinispan/SimulationDriver.java
+++ b/gora-infinispan/src/test/java/org/apache/gora/infinispan/SimulationDriver.java
@@ -106,7 +106,6 @@
// Create appropriate caches at each node.
ConfigurationBuilder builder = hotRodCacheConfiguration(getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false));
builder.indexing()
- .enable()
.index(Index.LOCAL)
.addProperty("default.directory_provider", "ram")
.addProperty("hibernate.search.default.exclusive_index_use","true")
diff --git a/gora-redis/pom.xml b/gora-redis/pom.xml
index ee33cb1..1057afd 100755
--- a/gora-redis/pom.xml
+++ b/gora-redis/pom.xml
@@ -54,24 +54,6 @@
<osgi.export>org.apache.gora.redis*;version="${project.version}";-noimport:=true</osgi.export>
</properties>
- <profiles>
- <profile>
- <id>redis-with-test</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.2</version>
- <configuration>
- <skipTests>false</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
<build>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
@@ -90,14 +72,6 @@
</testResources>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.2</version>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
diff --git a/gora-rethinkdb/src/test/java/org/apache/gora/rethinkdb/RethinkDBTestDriver.java b/gora-rethinkdb/src/test/java/org/apache/gora/rethinkdb/RethinkDBTestDriver.java
index 2f8d0c7..3df6758 100644
--- a/gora-rethinkdb/src/test/java/org/apache/gora/rethinkdb/RethinkDBTestDriver.java
+++ b/gora-rethinkdb/src/test/java/org/apache/gora/rethinkdb/RethinkDBTestDriver.java
@@ -29,6 +29,8 @@
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.GenericContainer;
+import java.util.Properties;
+
/**
* Driver to set up an embedded RethinkDB database instance for Gora
* dataStore specific integration tests.
@@ -56,7 +58,7 @@
@Override
public void setUpClass() throws Exception {
log.info("Setting up RethinkDB test driver");
- conf.set(RethinkDBStoreParameters.RETHINK_DB_SERVER_HOST, "localhost");
+ conf.set(RethinkDBStoreParameters.RETHINK_DB_SERVER_HOST, rethinkdbContainer.getContainerIpAddress());
conf.set(RethinkDBStoreParameters.RETHINK_DB_SERVER_PORT,
rethinkdbContainer.getMappedPort(28015).toString());
log.info("RethinkDB Embedded Server started successfully.");
@@ -73,10 +75,15 @@
@Override
public <K, T extends Persistent> DataStore<K, T> createDataStore(Class<K> keyClass,
Class<T> persistentClass) throws GoraException {
-
+ // Override properties (reads from gora.properties) using test container configuration (defined in #setUpClass)
+ Properties props = DataStoreFactory.createProps();
+ props.setProperty(RethinkDBStoreParameters.RETHINK_DB_SERVER_HOST,
+ conf.get(RethinkDBStoreParameters.RETHINK_DB_SERVER_HOST));
+ props.setProperty(RethinkDBStoreParameters.RETHINK_DB_SERVER_PORT,
+ conf.get(RethinkDBStoreParameters.RETHINK_DB_SERVER_PORT));
final DataStore<K, T> dataStore = DataStoreFactory
.createDataStore((Class<? extends DataStore<K, T>>) dataStoreClass, keyClass,
- persistentClass, conf);
+ persistentClass, conf, props);
dataStores.add(dataStore);
log.info("Datastore for {} was added.", persistentClass);
return dataStore;
diff --git a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
index 5747346..e89aa20 100644
--- a/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
+++ b/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
@@ -137,7 +137,7 @@
*/
public Job createJob(DataStore<Long, Pageview> inStore,
DataStore<String, MetricDatum> outStore, int numReducer) throws IOException {
- Job job = new Job(getConf());
+ Job job = Job.getInstance(getConf());
job.setJobName("Log Analytics");
log.info("Creating Hadoop Job: {}", job.getJobName());
job.setNumReduceTasks(numReducer);