Skip to content
Permalink
Browse files
Add formatting to pom (#29)
  • Loading branch information
keith-turner committed Nov 2, 2018
1 parent fa87691 commit a5cb521cb16b051b63a54e0e1022bdfcafccbafe
Showing 65 changed files with 1,071 additions and 432 deletions.

Large diffs are not rendered by default.

File renamed without changes.
217 pom.xml
@@ -17,29 +17,25 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>18</version>
</parent>

<groupId>org.apache.accumulo</groupId>
<artifactId>accumulo-examples</artifactId>
<version>2.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Apache Accumulo Examples</name>
<description>Example code and corresponding documentation for using Apache Accumulo</description>

<properties>
<accumulo.version>2.0.0-alpha-1</accumulo.version>
<hadoop.version>3.1.1</hadoop.version>
<slf4j.version>1.7.21</slf4j.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<eclipseFormatterStyle>build/Eclipse-Accumulo-Codestyle.xml</eclipseFormatterStyle>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
@@ -49,84 +45,6 @@
</dependency>
</dependencies>
</dependencyManagement>

<build>
<pluginManagement>
<plugins>
<plugin>
<!-- Allows us to get the apache-ds bundle artifacts -->
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<optimize>true</optimize>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<!-- Allows us to get the apache-ds bundle artifacts -->
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<inherited>true</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>run-integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<configuration>
<cleanupDaemonThreads>false</cleanupDaemonThreads>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.12</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- This was added to ensure project only uses public API. Run with the following:
mvn checkstyle:checkstyle
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.beust</groupId>
@@ -209,4 +127,137 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<!-- Allows us to get the apache-ds bundle artifacts -->
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<optimize>true</optimize>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<!-- Allows us to get the apache-ds bundle artifacts -->
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<inherited>true</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>run-integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<configuration>
<cleanupDaemonThreads>false</cleanupDaemonThreads>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.12</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- This was added to ensure project only uses public API. Run with the following:
mvn checkstyle:checkstyle
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
<configLocation>build/checkstyle.xml</configLocation>
</configuration>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<version>1.2.0</version>
<executions>
<execution>
<id>sort-imports</id>
<goals>
<goal>sort</goal>
</goals>
</execution>
</executions>
<configuration>
<removeUnused>true</removeUnused>
<groups>java.,javax.,org.,com.</groups>
</configuration>
</plugin>
<plugin>
<!-- verify before compile; should be sorted already -->
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<executions>
<execution>
<id>verify-sorted-pom</id>
<phase>process-resources</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<id>format-java-source</id>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
<configuration>
<configFile>${eclipseFormatterStyle}</configFile>
<compilerCompliance>${maven.compiler.source}</compilerCompliance>
<compilerSource>${maven.compiler.source}</compilerSource>
<compilerTargetPlatform>${maven.compiler.target}</compilerTargetPlatform>
<lineEnding>LF</lineEnding>
<overrideConfigCompilerVersion>true</overrideConfigCompilerVersion>
<skipJsFormatting>true</skipJsFormatting>
<skipHtmlFormatting>true</skipHtmlFormatting>
<skipXmlFormatting>true</skipXmlFormatting>
<skipJsonFormatting>true</skipJsonFormatting>
<skipCssFormatting>true</skipCssFormatting>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -39,14 +39,17 @@
*/
public class BloomBatchScanner {

public static void main(String[] args) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
AccumuloClient client = Accumulo.newClient().usingProperties("conf/accumulo-client.properties").build();
public static void main(String[] args)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
AccumuloClient client = Accumulo.newClient().usingProperties("conf/accumulo-client.properties")
.build();

scan(client, "bloom_test1", 7);
scan(client, "bloom_test2", 7);
}

static void scan(AccumuloClient client, String tableName, int seed) throws TableNotFoundException {
static void scan(AccumuloClient client, String tableName, int seed)
throws TableNotFoundException {
Random r = new Random(seed);
HashSet<Range> ranges = new HashSet<>();
HashMap<String,Boolean> expectedRows = new HashMap<>();
@@ -64,7 +67,7 @@ static void scan(AccumuloClient client, String tableName, int seed) throws Table
System.out.println("Scanning " + tableName + " with seed " + seed);
try (BatchScanner scan = client.createBatchScanner(tableName, Authorizations.EMPTY, 20)) {
scan.setRanges(ranges);
for (Entry<Key, Value> entry : scan) {
for (Entry<Key,Value> entry : scan) {
Key key = entry.getKey();
if (!expectedRows.containsKey(key.getRow().toString())) {
System.out.println("Encountered unexpected key: " + key);
@@ -77,7 +80,7 @@ static void scan(AccumuloClient client, String tableName, int seed) throws Table

long t2 = System.currentTimeMillis();
System.out.println(String.format("Scan finished! %6.2f lookups/sec, %.2f secs, %d results",
lookups / ((t2 - t1) / 1000.0), ((t2 - t1) / 1000.0), results));
lookups / ((t2 - t1) / 1000.0), ((t2 - t1) / 1000.0), results));

int count = 0;
for (Entry<String,Boolean> entry : expectedRows.entrySet()) {
@@ -32,8 +32,10 @@

public class BloomFilters {

public static void main(String[] args) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
AccumuloClient client = Accumulo.newClient().usingProperties("conf/accumulo-client.properties").build();
public static void main(String[] args)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
AccumuloClient client = Accumulo.newClient().usingProperties("conf/accumulo-client.properties")
.build();
try {
System.out.println("Creating bloom_test1 and bloom_test2");
client.tableOperations().create("bloom_test1");
@@ -64,8 +66,8 @@ public static void main(String[] args) throws AccumuloException, AccumuloSecurit
}

// write a million random rows
static void writeData(AccumuloClient client, String tableName, int seed) throws TableNotFoundException,
MutationsRejectedException{
static void writeData(AccumuloClient client, String tableName, int seed)
throws TableNotFoundException, MutationsRejectedException {
Random r = new Random(seed);
try (BatchWriter bw = client.createBatchWriter(tableName)) {
for (int x = 0; x < 1_000_000; x++) {
@@ -27,8 +27,10 @@

public class BloomFiltersNotFound {

public static void main(String[] args) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
AccumuloClient client = Accumulo.newClient().usingProperties("conf/accumulo-client.properties").build();
public static void main(String[] args)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
AccumuloClient client = Accumulo.newClient().usingProperties("conf/accumulo-client.properties")
.build();
try {
client.tableOperations().create("bloom_test3");
client.tableOperations().create("bloom_test4");
@@ -24,7 +24,8 @@ public class BatchScannerOpts {
@Parameter(names = "--scanThreads", description = "Number of threads to use when batch scanning")
public Integer scanThreads = 10;

@Parameter(names = "--scanTimeout", converter = TimeConverter.class, description = "timeout used to fail a batch scan")
@Parameter(names = "--scanTimeout", converter = TimeConverter.class,
description = "timeout used to fail a batch scan")
public Long scanTimeout = Long.MAX_VALUE;

}
@@ -27,16 +27,20 @@
public class BatchWriterOpts {
private static final BatchWriterConfig BWDEFAULTS = new BatchWriterConfig();

@Parameter(names = "--batchThreads", description = "Number of threads to use when writing large batches")
@Parameter(names = "--batchThreads",
description = "Number of threads to use when writing large batches")
public Integer batchThreads = BWDEFAULTS.getMaxWriteThreads();

@Parameter(names = "--batchLatency", converter = TimeConverter.class, description = "The maximum time to wait before flushing data to servers when writing")
@Parameter(names = "--batchLatency", converter = TimeConverter.class,
description = "The maximum time to wait before flushing data to servers when writing")
public Long batchLatency = BWDEFAULTS.getMaxLatency(TimeUnit.MILLISECONDS);

@Parameter(names = "--batchMemory", converter = MemoryConverter.class, description = "memory used to batch data when writing")
@Parameter(names = "--batchMemory", converter = MemoryConverter.class,
description = "memory used to batch data when writing")
public Long batchMemory = BWDEFAULTS.getMaxMemory();

@Parameter(names = "--batchTimeout", converter = TimeConverter.class, description = "timeout used to fail a batch write")
@Parameter(names = "--batchTimeout", converter = TimeConverter.class,
description = "timeout used to fail a batch write")
public Long batchTimeout = BWDEFAULTS.getTimeout(TimeUnit.MILLISECONDS);

public BatchWriterConfig getBatchWriterConfig() {

0 comments on commit a5cb521

Please sign in to comment.