Skip to content

Commit

Permalink
re apache#1474: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ivakegg committed Jan 27, 2020
1 parent eed0bae commit b2b4dd7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 27 deletions.
Expand Up @@ -24,57 +24,57 @@
/**
* A configuration object that can be used with the table clone command in the
* {@link TableOperations}.
*
*
* @since 1.10 and 2.1
*/
public interface CloneConfiguration {
/**
* Determines if memory is flushed in the source table before cloning.
*
*
* @return true if memory is flushed in the source table before cloning.
*/
public boolean isFlush();

/**
* The source table properties are copied. This allows overriding of some of those properties.
*
*
* @return The source table properties to override.
*/
public Map<String,String> getPropertiesToSet();

/**
* The source table properties are copied, this allows reverting to system defaults for some of
* those properties.
*
*
* @return The properties that are to be reverted to system defaults.
*/
public Set<String> getPropertiesToExclude();

/**
* The new table is normally brought online after the cloning process. This allows leaving the new
* table offline
*
*
* @return true if the new table is to be kept offline after cloning.
*/
public boolean isKeepOffline();

/**
* A CloneConfiguration builder
*
*
* @since 1.10 and 2.1
*/
public static interface Builder {
/**
* Determines if memory is flushed in the source table before cloning.
*
*
* @param flush
* true if memory is flushed in the source table before cloning.
*/
public Builder setFlush(boolean flush);

/**
* The source table properties are copied. This allows overriding of some of those properties.
*
*
* @param propertiesToSet
* The source table properties to override.
*/
Expand All @@ -83,7 +83,7 @@ public static interface Builder {
/**
* The source table properties are copied, this allows reverting to system defaults for some of
* those properties.
*
*
* @param propertiesToExclude
* The properties that are to be reverted to system defaults.
*/
Expand All @@ -92,15 +92,15 @@ public static interface Builder {
/**
* The new table is normally brought online after the cloning process. This allows leaving the
* new table offline
*
*
* @param keepOffline
* true if the new table is to be kept offline after cloning.
*/
public Builder setKeepOffline(boolean keepOffline);

/**
* Build the clone configuration
*
*
* @return the built immutable clone configuration
*/
public CloneConfiguration build();
Expand Down
Expand Up @@ -26,7 +26,7 @@

/**
* A {@link CloneConfiguration} implementation which also implements the builder thereof
*
*
* @since 1.10 and 2.1
*/
public class CloneConfigurationImpl implements CloneConfiguration, CloneConfiguration.Builder {
Expand Down
Expand Up @@ -74,10 +74,8 @@ public int execute(final String fullCommand, final CommandLine cl, final Shell s
}

shellState.getConnector().tableOperations().clone(cl.getArgs()[0], cl.getArgs()[1],
CloneConfigurationImpl.builder().setFlush(flush)
.setPropertiesToSet(props)
.setPropertiesToExclude(exclude)
.setKeepOffline(keepOffline).build());
CloneConfigurationImpl.builder().setFlush(flush).setPropertiesToSet(props)
.setPropertiesToExclude(exclude).setKeepOffline(keepOffline).build());
return 0;
}

Expand Down
Expand Up @@ -16,6 +16,11 @@
*/
package org.apache.accumulo.test.functional;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -26,6 +31,7 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeSet;

import org.apache.accumulo.cluster.AccumuloCluster;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.BatchWriter;
Expand Down Expand Up @@ -58,11 +64,6 @@
import org.junit.Assume;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/**
*
*/
Expand Down Expand Up @@ -299,12 +300,9 @@ public void testOfflineClone() throws Exception {

Set<String> exclude = new HashSet<>();
exclude.add(Property.TABLE_FILE_MAX.getKey());

c.tableOperations().clone(table1, table2,
CloneConfigurationImpl.builder().setFlush(true)
.setPropertiesToSet(props)
.setPropertiesToExclude(exclude)
.setKeepOffline(true).build());

c.tableOperations().clone(table1, table2, CloneConfigurationImpl.builder().setFlush(true)
.setPropertiesToSet(props).setPropertiesToExclude(exclude).setKeepOffline(true).build());

checkTableState(table2, c, TableState.OFFLINE);

Expand Down

0 comments on commit b2b4dd7

Please sign in to comment.