You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rya.apache.org by mi...@apache.org on 2016/10/15 20:07:25 UTC
[65/69] [abbrv] incubator-rya git commit: RYA-179 fixed license
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/1d33b435/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java
index e8e9eb2..c4cbdb9 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java
@@ -1,24 +1,22 @@
-package org.apache.rya.accumulo.mr.merge.demo;
-
/*
- * #%L
- * org.apache.rya.accumulo.mr.merge
- * %%
- * Copyright (C) 2014 Rya
- * %%
- * 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
+ * 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
+ * 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.
- * #L%
+ * 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 org.apache.rya.accumulo.mr.merge.demo;
import static org.apache.rya.accumulo.mr.merge.util.TestUtils.createRyaStatement;
import static org.apache.rya.accumulo.mr.merge.util.ToolConfigUtils.makeArgument;
@@ -91,13 +89,13 @@ public class MergeToolDemo {
private AccumuloDualInstanceDriver accumuloDualInstanceDriver;
- public static void main(String args[]) {
+ public static void main(final String args[]) {
DemoUtilities.setupLogging(LOGGING_DETAIL);
log.info("Setting up Merge Tool Demo");
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
- public void uncaughtException(Thread thread, Throwable throwable) {
+ public void uncaughtException(final Thread thread, final Throwable throwable) {
log.fatal("Uncaught exception in " + thread.getName(), throwable);
}
});
@@ -109,7 +107,7 @@ public class MergeToolDemo {
log.info("Shutting down...");
try {
mergeToolDemo.tearDown();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error while shutting down", e);
} finally {
log.info("Done shutting down");
@@ -120,12 +118,12 @@ public class MergeToolDemo {
try {
mergeToolDemo.setUp();
mergeToolDemo.testMergeTool();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error while testing merge tool", e);
} finally {
try {
mergeToolDemo.tearDown();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error shutting down merge tool.", e);
}
}
@@ -154,7 +152,7 @@ public class MergeToolDemo {
accumuloDualInstanceDriver.tearDown();
}
- private void mergeToolRun(Date startDate) {
+ private void mergeToolRun(final Date startDate) {
MergeTool.setupAndRun(new String[] {
makeArgument(MRUtils.AC_MOCK_PROP, Boolean.toString(IS_MOCK)),
makeArgument(MRUtils.AC_INSTANCE_PROP, PARENT_INSTANCE),
@@ -184,7 +182,7 @@ public class MergeToolDemo {
public void testMergeTool() throws Exception {
log.info("");
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("Cases to check\n");
sb.append("\n");
sb.append("| **case** | **Parent** | **Child** | **assume that** | **merge modification** | **in parent after** |\n");
@@ -211,51 +209,51 @@ public class MergeToolDemo {
// This statement was in both parent/child instances a month ago but after the start time of yesterday
// the child deleted it and the parent still has it. It should be deleted from the parent after merging.
- RyaStatement ryaStatementCase1 = createRyaStatement("c1", "parent older", "child missing", LAST_MONTH);
+ final RyaStatement ryaStatementCase1 = createRyaStatement("c1", "parent older", "child missing", LAST_MONTH);
// This statement was added by the parent after the start time of yesterday and doesn't exist in the child.
// It should stay in the parent after merging.
- RyaStatement ryaStatementCase2 = createRyaStatement("c2", "parent newer", "child missing", TODAY);
+ final RyaStatement ryaStatementCase2 = createRyaStatement("c2", "parent newer", "child missing", TODAY);
// This statement was in both parent/child instances a month ago but after the start time of yesterday
// the parent deleted it and the child still has it. It should stay deleted in the parent after merging.
- RyaStatement ryaStatementCase3 = createRyaStatement("c3", "parent missing", "child older", LAST_MONTH);
+ final RyaStatement ryaStatementCase3 = createRyaStatement("c3", "parent missing", "child older", LAST_MONTH);
// This statement was added by the child after the start time of yesterday and doesn't exist in the parent.
// It should be added to the parent after merging.
- RyaStatement ryaStatementCase4 = createRyaStatement("c4", "parent missing", "child newer", TODAY);
+ final RyaStatement ryaStatementCase4 = createRyaStatement("c4", "parent missing", "child newer", TODAY);
// This statement was in both parent/child instances a month ago and is before the start time of yesterday
// but it was left alone. It should remain in the parent after merging.
- RyaStatement ryaStatementCase5 = createRyaStatement("c5", "parent older", "child older", LAST_MONTH);
+ final RyaStatement ryaStatementCase5 = createRyaStatement("c5", "parent older", "child older", LAST_MONTH);
// This statement was added by the parent and child after the start time of yesterday.
// It should remain in the parent after merging.
- RyaStatement ryaStatementCase6 = createRyaStatement("c6", "parent newer", "child newer", TODAY);
+ final RyaStatement ryaStatementCase6 = createRyaStatement("c6", "parent newer", "child newer", TODAY);
// This statement was modified by the child after the start time of yesterday.
// It should deleted and then re-added to the parent with the new child data after merging.
- RyaStatement ryaStatementCase7 = createRyaStatement("c7", "parent older", "child newer", LAST_MONTH);
+ final RyaStatement ryaStatementCase7 = createRyaStatement("c7", "parent older", "child newer", LAST_MONTH);
// This statement was modified by the parent after the start time of yesterday.
// It should deleted and then re-added to the parent with the new child data after merging.
- RyaStatement ryaStatementCase8 = createRyaStatement("c8", "parent newer", "child older", LAST_MONTH);
+ final RyaStatement ryaStatementCase8 = createRyaStatement("c8", "parent newer", "child older", LAST_MONTH);
// This statement was modified by the child to change the column visibility.
// The parent should combine the child's visibility with its visibility.
- RyaStatement ryaStatementVisibilityDifferent = createRyaStatement("c9", "I see", "you", LAST_MONTH);
+ final RyaStatement ryaStatementVisibilityDifferent = createRyaStatement("c9", "I see", "you", LAST_MONTH);
ryaStatementVisibilityDifferent.setColumnVisibility(PARENT_COLUMN_VISIBILITY.getExpression());
// Change statements that were updated by the parent or child after the start time.
- RyaStatement ryaStatementCase7Updated = TestUtils.copyRyaStatement(ryaStatementCase7);
+ final RyaStatement ryaStatementCase7Updated = TestUtils.copyRyaStatement(ryaStatementCase7);
ryaStatementCase7Updated.setSubject(TestUtils.createRyaUri("c7 BOB"));
ryaStatementCase7Updated.setTimestamp(TODAY.getTime());
- RyaStatement ryaStatementCase8Updated = TestUtils.copyRyaStatement(ryaStatementCase8);
+ final RyaStatement ryaStatementCase8Updated = TestUtils.copyRyaStatement(ryaStatementCase8);
ryaStatementCase8Updated.setSubject(TestUtils.createRyaUri("c8 SUSAN"));
ryaStatementCase8Updated.setTimestamp(TODAY.getTime());
- RyaStatement ryaStatementVisibilityDifferentUpdated = TestUtils.copyRyaStatement(ryaStatementVisibilityDifferent);
+ final RyaStatement ryaStatementVisibilityDifferentUpdated = TestUtils.copyRyaStatement(ryaStatementVisibilityDifferent);
ryaStatementVisibilityDifferentUpdated.setColumnVisibility(CHILD_COLUMN_VISIBILITY.getExpression());
// Setup initial parent instance with 7 rows
@@ -282,7 +280,7 @@ public class MergeToolDemo {
childDao.add(ryaStatementCase8); // Merging should add statement
// Create 5 hour 5 minute 5 second and 5 millisecond offset metadata key
- Long timeOffset = TimeUnit.HOURS.toMillis(5) + TimeUnit.MINUTES.toMillis(5) + TimeUnit.SECONDS.toMillis(5) + TimeUnit.MILLISECONDS.toMillis(5);
+ final Long timeOffset = TimeUnit.HOURS.toMillis(5) + TimeUnit.MINUTES.toMillis(5) + TimeUnit.SECONDS.toMillis(5) + TimeUnit.MILLISECONDS.toMillis(5);
log.info("Creating parent time offset of: " + TimeUtils.getDurationBreakdown(timeOffset));
AccumuloRyaUtils.setTimeOffset(timeOffset, childDao);
}
@@ -308,8 +306,8 @@ public class MergeToolDemo {
AccumuloRyaUtils.printTablePretty(PARENT_TABLE_PREFIX + RdfCloudTripleStoreConstants.TBL_SPO_SUFFIX, parentConfig);
- Scanner scanner = AccumuloRyaUtils.getScanner(PARENT_TABLE_PREFIX + RdfCloudTripleStoreConstants.TBL_SPO_SUFFIX, parentConfig);
- Iterator<Entry<Key, Value>> iterator = scanner.iterator();
+ final Scanner scanner = AccumuloRyaUtils.getScanner(PARENT_TABLE_PREFIX + RdfCloudTripleStoreConstants.TBL_SPO_SUFFIX, parentConfig);
+ final Iterator<Entry<Key, Value>> iterator = scanner.iterator();
int count = 0;
while (iterator.hasNext()) {
iterator.next();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/1d33b435/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/util/DemoUtilities.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/util/DemoUtilities.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/util/DemoUtilities.java
index 809f30b..92263a1 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/util/DemoUtilities.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/util/DemoUtilities.java
@@ -1,24 +1,22 @@
-package org.apache.rya.accumulo.mr.merge.demo.util;
-
/*
- * #%L
- * org.apache.rya.accumulo.mr.merge
- * %%
- * Copyright (C) 2014 Rya
- * %%
- * 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
+ * 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
+ * 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.
- * #L%
+ * 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 org.apache.rya.accumulo.mr.merge.demo.util;
import java.util.Scanner;
@@ -54,7 +52,7 @@ public final class DemoUtilities {
* Create a new {@link LoggingDetail}.
* @param patternLayout the {@link PatternLayout}.
*/
- private LoggingDetail(PatternLayout patternLayout) {
+ private LoggingDetail(final PatternLayout patternLayout) {
this.patternLayout = patternLayout;
}
@@ -95,7 +93,7 @@ public final class DemoUtilities {
* Sets up log4j logging to fit the demo's needs.
* @param loggingDetail the {@link LoggingDetail} to use.
*/
- public static void setupLogging(LoggingDetail loggingDetail) {
+ public static void setupLogging(final LoggingDetail loggingDetail) {
// Turn off all the loggers and customize how they write to the console.
final Logger rootLogger = LogManager.getRootLogger();
rootLogger.setLevel(Level.OFF);
@@ -119,7 +117,7 @@ public final class DemoUtilities {
* @param isPromptEnabled {@code true} if prompt display is enabled. {@code false}
* otherwise.
*/
- public static void promptEnterKey(boolean isPromptEnabled) {
+ public static void promptEnterKey(final boolean isPromptEnabled) {
if (isPromptEnabled) {
log.info("Press \"ENTER\" to continue...");
KEYBOARD_SCANNER.nextLine();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/1d33b435/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/AccumuloDualInstanceDriver.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/AccumuloDualInstanceDriver.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/AccumuloDualInstanceDriver.java
index f779624..c5a5a29 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/AccumuloDualInstanceDriver.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/AccumuloDualInstanceDriver.java
@@ -1,24 +1,22 @@
-package org.apache.rya.accumulo.mr.merge.driver;
-
/*
- * #%L
- * org.apache.rya.accumulo.mr.merge
- * %%
- * Copyright (C) 2014 Rya
- * %%
- * 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
+ * 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
+ * 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.
- * #L%
+ * 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 org.apache.rya.accumulo.mr.merge.driver;
import java.io.File;
import java.util.Collection;
@@ -50,11 +48,11 @@ import twitter4j.Logger;
public class AccumuloDualInstanceDriver {
private static final Logger log = Logger.getLogger(AccumuloDualInstanceDriver.class);
- private boolean isMock;
- private boolean shouldCreateIndices;
- private boolean isParentReadOnly;
- private boolean isChildReadOnly;
- private boolean doesChildInitiallyExist;
+ private final boolean isMock;
+ private final boolean shouldCreateIndices;
+ private final boolean isParentReadOnly;
+ private final boolean isChildReadOnly;
+ private final boolean doesChildInitiallyExist;
public static final String PARENT_USER_NAME = "parent_user";
public static final String PARENT_PASSWORD = "parent_pwd";
@@ -70,8 +68,8 @@ public class AccumuloDualInstanceDriver {
public static final String CHILD_AUTH = "child_auth";
public static final ColumnVisibility CHILD_COLUMN_VISIBILITY = new ColumnVisibility(CHILD_AUTH);
- private AccumuloInstanceDriver parentAccumuloInstanceDriver;
- private AccumuloInstanceDriver childAccumuloInstanceDriver;
+ private final AccumuloInstanceDriver parentAccumuloInstanceDriver;
+ private final AccumuloInstanceDriver childAccumuloInstanceDriver;
/**
* Creates a new instance of {@link AccumuloDualInstanceDriver}.
@@ -86,14 +84,14 @@ public class AccumuloDualInstanceDriver {
* @param doesChildInitiallyExist {@code true} if all the child instance exists initially.
* {@code false} otherwise.
*/
- public AccumuloDualInstanceDriver(boolean isMock, boolean shouldCreateIndices, boolean isParentReadOnly, boolean isChildReadOnly, boolean doesChildInitiallyExist) {
+ public AccumuloDualInstanceDriver(final boolean isMock, final boolean shouldCreateIndices, final boolean isParentReadOnly, final boolean isChildReadOnly, final boolean doesChildInitiallyExist) {
this.isMock = isMock;
this.shouldCreateIndices = shouldCreateIndices;
this.isParentReadOnly = isParentReadOnly;
this.isChildReadOnly = isChildReadOnly;
this.doesChildInitiallyExist = doesChildInitiallyExist;
- String parentUser = isMock ? PARENT_USER_NAME : AccumuloInstanceDriver.ROOT_USER_NAME;
- String childUser = isMock ? CHILD_USER_NAME : AccumuloInstanceDriver.ROOT_USER_NAME;
+ final String parentUser = isMock ? PARENT_USER_NAME : AccumuloInstanceDriver.ROOT_USER_NAME;
+ final String childUser = isMock ? CHILD_USER_NAME : AccumuloInstanceDriver.ROOT_USER_NAME;
parentAccumuloInstanceDriver = new AccumuloInstanceDriver("Parent", isMock, shouldCreateIndices, isParentReadOnly, true, parentUser, PARENT_PASSWORD, PARENT_INSTANCE, PARENT_TABLE_PREFIX, PARENT_AUTH);
childAccumuloInstanceDriver = new AccumuloInstanceDriver("Child", isMock, shouldCreateIndices, isChildReadOnly, false, childUser, CHILD_PASSWORD, CHILD_INSTANCE, CHILD_TABLE_PREFIX, CHILD_AUTH);
}
@@ -206,7 +204,7 @@ public class AccumuloDualInstanceDriver {
* @throws AccumuloException
* @throws AccumuloSecurityException
*/
- public void addParentAuths(String... auths) throws AccumuloException, AccumuloSecurityException {
+ public void addParentAuths(final String... auths) throws AccumuloException, AccumuloSecurityException {
parentAccumuloInstanceDriver.addAuths(auths);
}
@@ -216,7 +214,7 @@ public class AccumuloDualInstanceDriver {
* @throws AccumuloException
* @throws AccumuloSecurityException
*/
- public void addChildAuths(String... auths) throws AccumuloException, AccumuloSecurityException {
+ public void addChildAuths(final String... auths) throws AccumuloException, AccumuloSecurityException {
childAccumuloInstanceDriver.addAuths(auths);
}
@@ -243,7 +241,7 @@ public class AccumuloDualInstanceDriver {
* @param ryaStatements the {@link Collection} of {@link RyaStatement}s.
* @throws RyaDAOException
*/
- public void addParentRyaStatements(Collection<RyaStatement> ryaStatements) throws RyaDAOException {
+ public void addParentRyaStatements(final Collection<RyaStatement> ryaStatements) throws RyaDAOException {
addRyaStatements(ryaStatements.iterator(), parentAccumuloInstanceDriver.getDao());
}
@@ -252,7 +250,7 @@ public class AccumuloDualInstanceDriver {
* @param ryaStatements the {@link Collection} of {@link RyaStatement}s.
* @throws RyaDAOException
*/
- public void addChildRyaStatements(Collection<RyaStatement> ryaStatements) throws RyaDAOException {
+ public void addChildRyaStatements(final Collection<RyaStatement> ryaStatements) throws RyaDAOException {
addRyaStatements(ryaStatements.iterator(), childAccumuloInstanceDriver.getDao());
}
@@ -261,7 +259,7 @@ public class AccumuloDualInstanceDriver {
* @param ryaStatementIterator the {@link RyaStatement} {@link Iterator}.
* @throws RyaDAOException
*/
- public void addParentRyaStatements(Iterator<RyaStatement> ryaStatementIterator) throws RyaDAOException {
+ public void addParentRyaStatements(final Iterator<RyaStatement> ryaStatementIterator) throws RyaDAOException {
addRyaStatements(ryaStatementIterator, parentAccumuloInstanceDriver.getDao());
}
@@ -270,7 +268,7 @@ public class AccumuloDualInstanceDriver {
* @param ryaStatementIterator the {@link RyaStatement} {@link Iterator}.
* @throws RyaDAOException
*/
- public void addChildRyaStatements(Iterator<RyaStatement> ryaStatementIterator) throws RyaDAOException {
+ public void addChildRyaStatements(final Iterator<RyaStatement> ryaStatementIterator) throws RyaDAOException {
addRyaStatements(ryaStatementIterator, childAccumuloInstanceDriver.getDao());
}
@@ -279,7 +277,7 @@ public class AccumuloDualInstanceDriver {
* @param ryaStatement the {@link RyaStatement}.
* @throws RyaDAOException
*/
- public void addParentRyaStatement(RyaStatement ryaStatement) throws RyaDAOException {
+ public void addParentRyaStatement(final RyaStatement ryaStatement) throws RyaDAOException {
addRyaStatement(ryaStatement, parentAccumuloInstanceDriver.getDao());
}
@@ -288,7 +286,7 @@ public class AccumuloDualInstanceDriver {
* @param ryaStatement the {@link RyaStatement}.
* @throws RyaDAOException
*/
- public void addChildRyaStatement(RyaStatement ryaStatement) throws RyaDAOException {
+ public void addChildRyaStatement(final RyaStatement ryaStatement) throws RyaDAOException {
addRyaStatement(ryaStatement, childAccumuloInstanceDriver.getDao());
}
@@ -298,7 +296,7 @@ public class AccumuloDualInstanceDriver {
* @param dao the {@link AccumuloRyaDAO}.
* @throws RyaDAOException
*/
- private static void addRyaStatements(Iterator<RyaStatement> ryaStatementIterator, AccumuloRyaDAO dao) throws RyaDAOException {
+ private static void addRyaStatements(final Iterator<RyaStatement> ryaStatementIterator, final AccumuloRyaDAO dao) throws RyaDAOException {
dao.add(ryaStatementIterator);
}
@@ -307,7 +305,7 @@ public class AccumuloDualInstanceDriver {
* @param ryaStatement the {@link RyaStatement}.
* @throws RyaDAOException
*/
- private static void addRyaStatement(RyaStatement ryaStatement, AccumuloRyaDAO dao) throws RyaDAOException {
+ private static void addRyaStatement(final RyaStatement ryaStatement, final AccumuloRyaDAO dao) throws RyaDAOException {
dao.add(ryaStatement);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/1d33b435/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java
index 02391f9..a42b561 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java
@@ -1,24 +1,22 @@
-package org.apache.rya.accumulo.mr.merge.driver;
-
/*
- * #%L
- * org.apache.rya.accumulo.mr.merge
- * %%
- * Copyright (C) 2014 Rya
- * %%
- * 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
+ * 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
+ * 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.
- * #L%
+ * 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 org.apache.rya.accumulo.mr.merge.driver;
import static org.apache.rya.accumulo.mr.merge.util.TestUtils.LAST_MONTH;
import static org.apache.rya.accumulo.mr.merge.util.TestUtils.TODAY;
@@ -61,41 +59,41 @@ public class MiniAccumuloClusterDriver extends AccumuloDualInstanceDriver {
private void writeStatements() throws RyaDAOException, IOException {
// This statement was in both parent/child instances a month ago and is before the start time of yesterday
// but it was left alone. It should remain in the parent after merging.
- RyaStatement ryaStatementOutOfTimeRange = createRyaStatement("coach", "called", "timeout", LAST_MONTH);
+ final RyaStatement ryaStatementOutOfTimeRange = createRyaStatement("coach", "called", "timeout", LAST_MONTH);
// This statement was in both parent/child instances a month ago but after the start time of yesterday
// the parent deleted it and the child still has it. It should stay deleted in the parent after merging.
- RyaStatement ryaStatementParentDeletedAfter = createRyaStatement("parent", "deleted", "after", LAST_MONTH);
+ final RyaStatement ryaStatementParentDeletedAfter = createRyaStatement("parent", "deleted", "after", LAST_MONTH);
// This statement was added by the parent after the start time of yesterday and doesn't exist in the child.
// It should stay in the parent after merging.
- RyaStatement ryaStatementParentAddedAfter = createRyaStatement("parent", "added", "after", TODAY);
+ final RyaStatement ryaStatementParentAddedAfter = createRyaStatement("parent", "added", "after", TODAY);
// This statement was in both parent/child instances a month ago but after the start time of yesterday
// the child deleted it and the parent still has it. It should be deleted from the parent after merging.
- RyaStatement ryaStatementChildDeletedAfter = createRyaStatement("child", "deleted", "after", LAST_MONTH);
+ final RyaStatement ryaStatementChildDeletedAfter = createRyaStatement("child", "deleted", "after", LAST_MONTH);
// This statement was added by the child after the start time of yesterday and doesn't exist in the parent.
// It should be added to the parent after merging.
- RyaStatement ryaStatementChildAddedAfter = createRyaStatement("child", "added", "after", TODAY);
+ final RyaStatement ryaStatementChildAddedAfter = createRyaStatement("child", "added", "after", TODAY);
// This statement was modified by the child after the start of yesterday (The timestamp changes after updating)
// It should be updated in the parent to match the child.
- RyaStatement ryaStatementUpdatedByChild = createRyaStatement("bob", "catches", "ball", LAST_MONTH);
+ final RyaStatement ryaStatementUpdatedByChild = createRyaStatement("bob", "catches", "ball", LAST_MONTH);
- RyaStatement ryaStatementUntouchedByChild = createRyaStatement("bill", "talks to", "john", LAST_MONTH);
+ final RyaStatement ryaStatementUntouchedByChild = createRyaStatement("bill", "talks to", "john", LAST_MONTH);
- RyaStatement ryaStatementDeletedByChild = createRyaStatement("susan", "eats", "burgers", LAST_MONTH);
+ final RyaStatement ryaStatementDeletedByChild = createRyaStatement("susan", "eats", "burgers", LAST_MONTH);
- RyaStatement ryaStatementAddedByChild = createRyaStatement("ronnie", "plays", "guitar", TODAY);
+ final RyaStatement ryaStatementAddedByChild = createRyaStatement("ronnie", "plays", "guitar", TODAY);
// This statement was modified by the child to change the column visibility.
// The parent should combine the child's visibility with its visibility.
- RyaStatement ryaStatementVisibilityDifferent = createRyaStatement("I", "see", "you", LAST_MONTH);
+ final RyaStatement ryaStatementVisibilityDifferent = createRyaStatement("I", "see", "you", LAST_MONTH);
ryaStatementVisibilityDifferent.setColumnVisibility(PARENT_COLUMN_VISIBILITY.getExpression());
- List<RyaStatement> parentStatements = new ArrayList<>();
- List<RyaStatement> childStatements = new ArrayList<>();
+ final List<RyaStatement> parentStatements = new ArrayList<>();
+ final List<RyaStatement> childStatements = new ArrayList<>();
// Setup initial parent instance with 7 rows
// This is the state of the parent data (as it is today) before merging occurs which will use the specified start time of yesterday.
@@ -133,12 +131,12 @@ public class MiniAccumuloClusterDriver extends AccumuloDualInstanceDriver {
AccumuloRyaUtils.printTable(CHILD_TABLE_PREFIX + RdfCloudTripleStoreConstants.TBL_SPO_SUFFIX, getChildConfig());
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
log.info("Setting up MiniAccumulo Cluster");
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
- public void uncaughtException(Thread thread, Throwable throwable) {
+ public void uncaughtException(final Thread thread, final Throwable throwable) {
log.fatal("Uncaught exception in " + thread.getName(), throwable);
}
});
@@ -149,7 +147,7 @@ public class MiniAccumuloClusterDriver extends AccumuloDualInstanceDriver {
log.info("Populating clusters");
macDriver.writeStatements();
log.info("MiniAccumuloClusters running and populated");
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error setting up and writing statements", e);
keepRunning = false;
}
@@ -160,7 +158,7 @@ public class MiniAccumuloClusterDriver extends AccumuloDualInstanceDriver {
log.info("Shutting down...");
try {
macDriver.tearDown();
- } catch (Exception e) {
+ } catch (final Exception e) {
log.error("Error while shutting down", e);
} finally {
keepRunning = false;
@@ -172,7 +170,7 @@ public class MiniAccumuloClusterDriver extends AccumuloDualInstanceDriver {
while(keepRunning) {
try {
Thread.sleep(2000);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
log.error("Interrupted exception while running MiniAccumuloClusterDriver", e);
keepRunning = false;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/1d33b435/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
index 31b6884..8901461 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
@@ -1,24 +1,22 @@
-package org.apache.rya.accumulo.mr.merge.util;
-
/*
- * #%L
- * org.apache.rya.accumulo.mr.merge
- * %%
- * Copyright (C) 2014 Rya
- * %%
- * 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
+ * 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
+ * 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.
- * #L%
+ * 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 org.apache.rya.accumulo.mr.merge.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -66,7 +64,7 @@ public final class TestUtils {
* Creates a new {@link Occurrence}.
* @param sign the sign value: positive or negative.
*/
- private Occurrence(int sign) {
+ private Occurrence(final int sign) {
this.sign = sign;
}
@@ -100,7 +98,7 @@ public final class TestUtils {
* Creates a new {@link CalendarUnit}.
* @param milliseconds the milliseconds value of this unit.
*/
- private CalendarUnit(long milliseconds) {
+ private CalendarUnit(final long milliseconds) {
this.milliseconds = milliseconds;
}
@@ -125,7 +123,7 @@ public final class TestUtils {
* @param time the time to find the new time occurrence from. (in milliseconds)
* @return the value of one day before the specified {@code time}. (in milliseconds)
*/
- public static long dayBefore(long time) {
+ public static long dayBefore(final long time) {
return timeFrom(time, 1, CalendarUnit.DAY, Occurrence.BEFORE);
}
@@ -134,7 +132,7 @@ public final class TestUtils {
* @param date the {@link Date} to find the new time occurrence from.
* @return the {@link Date} value of one day before the specified {@code date}.
*/
- public static Date dayBefore(Date date) {
+ public static Date dayBefore(final Date date) {
return dateFrom(date, 1, CalendarUnit.DAY, Occurrence.BEFORE);
}
@@ -143,7 +141,7 @@ public final class TestUtils {
* @param time the time to find the new time occurrence from. (in milliseconds)
* @return the value of one month before the specified {@code time}. (in milliseconds)
*/
- public static long monthBefore(long time) {
+ public static long monthBefore(final long time) {
return timeFrom(time, 1, CalendarUnit.MONTH, Occurrence.BEFORE);
}
@@ -152,7 +150,7 @@ public final class TestUtils {
* @param date the {@link Date} to find the new time occurrence from.
* @return the {@link Date} value of one month before the specified {@code date}.
*/
- public static Date monthBefore(Date date) {
+ public static Date monthBefore(final Date date) {
return dateFrom(date, 1, CalendarUnit.MONTH, Occurrence.BEFORE);
}
@@ -166,9 +164,9 @@ public final class TestUtils {
* @param occurrence when the new time takes place, before or after.
* @return the value of the new time. (in milliseconds)
*/
- public static long timeFrom(long time, long duration, CalendarUnit unit, Occurrence occurrence) {
- long durationInMillis = occurrence.getSign() * duration * unit.getMilliseconds();
- long newTime = time + durationInMillis;
+ public static long timeFrom(final long time, final long duration, final CalendarUnit unit, final Occurrence occurrence) {
+ final long durationInMillis = occurrence.getSign() * duration * unit.getMilliseconds();
+ final long newTime = time + durationInMillis;
return newTime;
}
@@ -182,9 +180,9 @@ public final class TestUtils {
* @param occurrence when the new time takes place, before or after.
* @return the value of the new {@link Date}.
*/
- public static Date dateFrom(Date date, long duration, CalendarUnit unit, Occurrence occurrence) {
- long time = timeFrom(date.getTime(), duration, unit, occurrence);
- Date newDate = new Date(time);
+ public static Date dateFrom(final Date date, final long duration, final CalendarUnit unit, final Occurrence occurrence) {
+ final long time = timeFrom(date.getTime(), duration, unit, occurrence);
+ final Date newDate = new Date(time);
return newDate;
}
@@ -197,11 +195,11 @@ public final class TestUtils {
* @param config the {@link AccumuloRdfConfiguration} for the instance.
* @throws RyaDAOException
*/
- public static void assertStatementInInstance(String description, int verifyResultCount, RyaStatement matchStatement, AccumuloRyaDAO dao, AccumuloRdfConfiguration config) throws RyaDAOException {
- CloseableIteration<RyaStatement, RyaDAOException> iter = dao.getQueryEngine().query(matchStatement, config);
+ public static void assertStatementInInstance(final String description, final int verifyResultCount, final RyaStatement matchStatement, final AccumuloRyaDAO dao, final AccumuloRdfConfiguration config) throws RyaDAOException {
+ final CloseableIteration<RyaStatement, RyaDAOException> iter = dao.getQueryEngine().query(matchStatement, config);
int count = 0;
while (iter.hasNext()) {
- RyaStatement statement = iter.next();
+ final RyaStatement statement = iter.next();
assertTrue(description + " - match subject: " + matchStatement, matchStatement.getSubject().equals(statement.getSubject()));
assertTrue(description + " - match predicate: " + matchStatement, matchStatement.getPredicate().equals(statement.getPredicate()));
assertTrue(description + " - match object match: " + matchStatement, matchStatement.getObject().equals(statement.getObject()));
@@ -216,7 +214,7 @@ public final class TestUtils {
* @param localName the URI's local name.
* @return the {@link RyraURI}.
*/
- public static RyaURI createRyaUri(String localName) {
+ public static RyaURI createRyaUri(final String localName) {
return AccumuloRyaUtils.createRyaUri(NAMESPACE, localName);
}
@@ -228,11 +226,11 @@ public final class TestUtils {
* @param date the {@link Date} to use for the key's timestamp.
* @return the {@link RyaStatement}.
*/
- public static RyaStatement createRyaStatement(String subject, String predicate, String object, Date date) {
- RyaURI subjectUri = createRyaUri(subject);
- RyaURI predicateUri = createRyaUri(predicate);
- RyaURI objectUri = createRyaUri(object);
- RyaStatement ryaStatement = new RyaStatement(subjectUri, predicateUri, objectUri);
+ public static RyaStatement createRyaStatement(final String subject, final String predicate, final String object, final Date date) {
+ final RyaURI subjectUri = createRyaUri(subject);
+ final RyaURI predicateUri = createRyaUri(predicate);
+ final RyaURI objectUri = createRyaUri(object);
+ final RyaStatement ryaStatement = new RyaStatement(subjectUri, predicateUri, objectUri);
if (date != null) {
ryaStatement.setTimestamp(date.getTime());
}
@@ -244,7 +242,7 @@ public final class TestUtils {
* @param s the {@link RyaStatement} to copy.
* @return the newly copied {@link RyaStatement}.
*/
- public static RyaStatement copyRyaStatement(RyaStatement s) {
+ public static RyaStatement copyRyaStatement(final RyaStatement s) {
return new RyaStatement(s.getSubject(), s.getPredicate(), s.getObject(), s.getContext(), s.getQualifer(), s.getColumnVisibility(), s.getValue(), s.getTimestamp());
}
}
\ No newline at end of file