Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleaned up pom file, added main directory, timeuuid and cassandra-thr…

…ift jar to pom
  • Loading branch information...
commit 3f6cdc2c221283cf2af377d12902eed363f99acd 1 parent e83822b
zznate authored
View
144 pom.xml
@@ -1,74 +1,96 @@
<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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.flume</groupId>
- <artifactId>flume-cassandra-plugin</artifactId>
- <version>1.0.0</version>
- <packaging>jar</packaging>
+ <groupId>org.apache.flume</groupId>
+ <artifactId>flume-cassandra-plugin</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
- <name>Flume Cassandra Plugin</name>
- <url>http://maven.apache.org</url>
+ <name>Flume Cassandra Plugin</name>
+ <url>http://github.com/thobbs/flume-cassandra-plugin</url>
+ <licenses>
+ <license>
+ <name>MIT License</name>
+ <distribution>repo</distribution>
+ <url>https://github.com/thobbs/flume-cassandra-plugin/blob/master/LICENSE</url>
+ </license>
+ </licenses>
+ <scm>
+ <connection>scm:git:git://github.com/thobbs/flume-cassandra-plugin.git</connection>
+ <developerConnection>scm:git:git@github.com:thobbs/flume-cassandra-plugin.git</developerConnection>
+ <url>http://github.com/thobbs/flume-cassandra-plugin/tree/master/</url>
+ </scm>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
+ <issueManagement>
+ <system>github</system>
+ <url>http://github.com/thobbs/flume-cassandra-plugin/issues</url>
+ </issueManagement>
- <build>
- <directory>target</directory>
- <outputDirectory>target/classes</outputDirectory>
+ <distributionManagement>
+ <site>
+ <id>github.com</id>
+ <url>gitsite:git@github.com/thobbs/flume-cassandra-plugin.git</url>
+ </site>
+ </distributionManagement>
- <sourceDirectory>src/java</sourceDirectory>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <dependencies>
- <dependency>
- <groupId>org.apache.cassandra</groupId>
- <artifactId>cassandra-all</artifactId>
- <version>1.0.6</version>
- </dependency>
+ <dependencies>
- <dependency>
- <groupId>com.cloudera.flume</groupId>
- <artifactId>flume</artifactId>
- <version>0.9.3-CDH3B4</version>
- </dependency>
+ <dependency>
+ <groupId>org.apache.cassandra</groupId>
+ <artifactId>cassandra-all</artifactId>
+ <version>1.0.6</version>
+ </dependency>
- <dependency>
- <groupId>com.eaio.uuid</groupId>
- <artifactId>uuid</artifactId>
- <version>3.2</version>
- </dependency>
+ <dependency>
+ <groupId>org.apache.cassandra</groupId>
+ <artifactId>cassandra-thrift</artifactId>
+ <version>1.0.6</version>
+ </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>6.3.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>com.cloudera.flume</groupId>
+ <artifactId>flume</artifactId>
+ <version>0.9.3-CDH3B4</version>
+ </dependency>
- <repositories>
- <repository>
- <id>cdh repository</id>
- <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
- </repository>
-
- <repository>
- <id>eaio.com</id>
- <url>http://eaio.com/maven2</url>
- </repository>
- </repositories>
+ <dependency>
+ <groupId>com.github.stephenc.eaio-uuid</groupId>
+ <artifactId>uuid</artifactId>
+ <version>3.2.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.3.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <repositories>
+ <repository>
+ <id>cdh repository</id>
+ <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
+ </repository>
+ </repositories>
</project>
View
0  ...a/plugins/flume/sink/CassandraClient.java → ...a/plugins/flume/sink/CassandraClient.java
File renamed without changes
View
15 ...ugins/flume/sink/LogsandraSyslogSink.java → ...ugins/flume/sink/LogsandraSyslogSink.java
@@ -1,15 +1,10 @@
package org.apache.cassandra.plugins.flume.sink;
import java.io.IOException;
-import java.util.Calendar;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.TimeZone;
+import java.util.*;
import org.apache.cassandra.thrift.Column;
import org.apache.cassandra.thrift.ConsistencyLevel;
-import org.safehaus.uuid.UUID;
-import org.safehaus.uuid.UUIDGenerator;
import com.cloudera.flume.conf.Context;
import com.cloudera.flume.conf.SinkFactory.SinkBuilder;
@@ -45,8 +40,6 @@
private CassandraClient cClient;
- private static final UUIDGenerator uuidGen = UUIDGenerator.getInstance();
-
private static final long MILLI_TO_MICRO = 1000; // 1ms = 1000us
public LogsandraSyslogSink(String[] servers) {
@@ -68,7 +61,7 @@ public void append(Event event) throws IOException, InterruptedException {
long timestamp = System.currentTimeMillis() * MILLI_TO_MICRO;
- UUID uuid = uuidGen.generateTimeBasedUUID();
+ UUID uuid = TimeUUIDUtils.getTimeUUID(timestamp);
String date = getDate();
String host = event.getHost();
@@ -119,9 +112,9 @@ public void append(Event event) throws IOException, InterruptedException {
Column[] entryColumns = {identColumn, sourceColumn, dateColumn, entryColumn};
- Long time = System.currentTimeMillis() * MILLI_TO_MICRO;
+
Column timeColumn = new Column();
- timeColumn.setName(toBytes(time));
+ timeColumn.setName(toBytes(timestamp));
timeColumn.setValue(uuid.toString().getBytes());
timeColumn.setTimestamp(timestamp);
View
0  ...ugins/flume/sink/SimpleCassandraSink.java → ...ugins/flume/sink/SimpleCassandraSink.java
File renamed without changes
View
0  ...dra/plugins/flume/sink/TimeUUIDUtils.java → ...dra/plugins/flume/sink/TimeUUIDUtils.java
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.