You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gora.apache.org by hs...@apache.org on 2012/11/16 07:22:39 UTC
svn commit: r1410210 - in /gora/trunk: ./ gora-accumulo/ gora-cassandra/
gora-core/ gora-dynamodb/ gora-hbase/
gora-hbase/src/main/java/org/apache/gora/hbase/query/
gora-hbase/src/main/java/org/apache/gora/hbase/store/
gora-hbase/src/test/java/org/apac...
Author: hsaputra
Date: Fri Nov 16 06:22:38 2012
New Revision: 1410210
URL: http://svn.apache.org/viewvc?rev=1410210&view=rev
Log:
Cleanup alignment and unneeded imports plus comments in the code. Add gitignore for intellijidea files.
Modified:
gora/trunk/ (props changed)
gora/trunk/gora-accumulo/ (props changed)
gora/trunk/gora-cassandra/ (props changed)
gora/trunk/gora-core/ (props changed)
gora/trunk/gora-dynamodb/ (props changed)
gora/trunk/gora-hbase/ (props changed)
gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/query/HBaseScannerResult.java
gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java
gora/trunk/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
gora/trunk/gora-sql/ (props changed)
gora/trunk/gora-tutorial/ (props changed)
gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
gora/trunk/sources-dist/ (props changed)
Propchange: gora/trunk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Nov 16 06:22:38 2012
@@ -14,6 +14,8 @@
# limitations under the License.
*~
+*.iml
+.idea
.classpath
.externalToolBuilders
.project
@@ -27,5 +29,5 @@ lib
ivy/ivy*.jar
/conf/*-site.xml
**/conf/*-site.xml
-
+classes
target
Propchange: gora/trunk/gora-accumulo/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Nov 16 06:22:38 2012
@@ -1 +1,15 @@
+*~
+*.iml
+.classpath
+.externalToolBuilders
+.project
+.settings
+.git
+.svn
+build
+lib
+**/lib/*.jar
+ivy/ivy*.jar
+/conf/*-site.xml
+**/conf/*-site.xml
target
Propchange: gora/trunk/gora-cassandra/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Nov 16 06:22:38 2012
@@ -1,4 +1,5 @@
*~
+*.iml
.classpath
.externalToolBuilders
.project
Propchange: gora/trunk/gora-core/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Nov 16 06:22:38 2012
@@ -1,4 +1,6 @@
*~
+*.iml
+.idea
.classpath
.externalToolBuilders
.project
Propchange: gora/trunk/gora-dynamodb/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 16 06:22:38 2012
@@ -0,0 +1,33 @@
+# 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.
+
+*~
+*.iml
+.idea
+.classpath
+.externalToolBuilders
+.project
+.settings
+.git
+.svn
+build
+dist
+lib
+**/lib/*.jar
+ivy/ivy*.jar
+/conf/*-site.xml
+**/conf/*-site.xml
+
+target
Propchange: gora/trunk/gora-hbase/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Nov 16 06:22:38 2012
@@ -1,4 +1,5 @@
*~
+*.iml
.classpath
.externalToolBuilders
.project
Modified: gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/query/HBaseScannerResult.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/query/HBaseScannerResult.java?rev=1410210&r1=1410209&r2=1410210&view=diff
==============================================================================
--- gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/query/HBaseScannerResult.java (original)
+++ gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/query/HBaseScannerResult.java Fri Nov 16 06:22:38 2012
@@ -21,7 +21,6 @@ package org.apache.gora.hbase.query;
import java.io.IOException;
import org.apache.gora.hbase.store.HBaseStore;
-import org.apache.gora.persistency.Persistent;
import org.apache.gora.persistency.impl.PersistentBase;
import org.apache.gora.query.Query;
import org.apache.hadoop.hbase.client.Result;
@@ -30,8 +29,7 @@ import org.apache.hadoop.hbase.client.Re
/**
* Result of a query based on an HBase scanner.
*/
-public class HBaseScannerResult<K, T extends PersistentBase>
- extends HBaseResult<K, T> {
+public class HBaseScannerResult<K, T extends PersistentBase> extends HBaseResult<K, T> {
private final ResultScanner scanner;
Modified: gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java?rev=1410210&r1=1410209&r2=1410210&view=diff
==============================================================================
--- gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java (original)
+++ gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseStore.java Fri Nov 16 06:22:38 2012
@@ -411,7 +411,7 @@ implements Configurable {
ResultScanner scanner = createScanner(query);
org.apache.gora.query.Result<K,T> result
- = new HBaseScannerResult<K,T>(this,query, scanner);
+ = new HBaseScannerResult<K,T>(this,query, scanner);
return result;
}
@@ -422,8 +422,7 @@ implements Configurable {
}
}
- public ResultScanner createScanner(Query<K, T> query)
- throws IOException {
+ public ResultScanner createScanner(Query<K, T> query) throws IOException {
final Scan scan = new Scan();
if (query.getStartKey() != null) {
scan.setStartRow(toBytes(query.getStartKey()));
Modified: gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java?rev=1410210&r1=1410209&r2=1410210&view=diff
==============================================================================
--- gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java (original)
+++ gora/trunk/gora-hbase/src/main/java/org/apache/gora/hbase/store/HBaseTableConnection.java Fri Nov 16 06:22:38 2012
@@ -43,7 +43,7 @@ import org.apache.hadoop.hbase.util.Pair
* Thread safe implementation to connect to a HBase table.
*
*/
-public class HBaseTableConnection implements HTableInterface{
+public class HBaseTableConnection implements HTableInterface {
/*
* The current implementation uses ThreadLocal HTable instances. It keeps
* track of the floating instances in order to correctly flush and close
@@ -67,8 +67,8 @@ public class HBaseTableConnection implem
* @param autoflush
* @throws IOException
*/
- public HBaseTableConnection(Configuration conf, String tableName,
- boolean autoflush) throws IOException {
+ public HBaseTableConnection(Configuration conf, String tableName, boolean autoflush)
+ throws IOException {
this.conf = conf;
this.tables = new ThreadLocal<HTable>();
this.tableName = tableName;
Modified: gora/trunk/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java?rev=1410210&r1=1410209&r2=1410210&view=diff
==============================================================================
--- gora/trunk/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java (original)
+++ gora/trunk/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java Fri Nov 16 06:22:38 2012
@@ -76,7 +76,7 @@ public class GoraHBaseTestDriver extends
}
}
- public Configuration getConf() {
+ public Configuration getConf() {
return hbaseUtil.getConfiguration();
}
Propchange: gora/trunk/gora-sql/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Nov 16 06:22:38 2012
@@ -1,4 +1,5 @@
*~
+*.iml
.classpath
.externalToolBuilders
.project
Propchange: gora/trunk/gora-tutorial/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Nov 16 06:22:38 2012
@@ -14,6 +14,7 @@
# limitations under the License.
*~
+*.iml
.classpath
.externalToolBuilders
.project
Modified: gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java
URL: http://svn.apache.org/viewvc/gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java?rev=1410210&r1=1410209&r2=1410210&view=diff
==============================================================================
--- gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java (original)
+++ gora/trunk/gora-tutorial/src/main/java/org/apache/gora/tutorial/log/LogAnalytics.java Fri Nov 16 06:22:38 2012
@@ -59,8 +59,8 @@ public class LogAnalytics extends Config
* read from the input data store.
* Note that all Hadoop serializable classes can be used as map output key and value.
*/
- public static class LogAnalyticsMapper
- extends GoraMapper<Long, Pageview, TextLong, LongWritable> {
+ public static class LogAnalyticsMapper extends GoraMapper<Long, Pageview, TextLong,
+ LongWritable> {
private LongWritable one = new LongWritable(1L);
@@ -74,8 +74,8 @@ public class LogAnalytics extends Config
};
@Override
- protected void map(Long key, Pageview pageview, Context context)
- throws IOException ,InterruptedException {
+ protected void map(Long key, Pageview pageview, Context context)
+ throws IOException ,InterruptedException {
Utf8 url = pageview.getUrl();
long day = getDay(pageview.getTimestamp());
@@ -99,14 +99,13 @@ public class LogAnalytics extends Config
* {@link MetricDatum} objects. The metric datum objects are stored
* as job outputs in the output data store.
*/
- public static class LogAnalyticsReducer
- extends GoraReducer<TextLong, LongWritable, String, MetricDatum> {
+ public static class LogAnalyticsReducer extends GoraReducer<TextLong, LongWritable,
+ String, MetricDatum> {
private MetricDatum metricDatum = new MetricDatum();
@Override
- protected void reduce(TextLong tuple
- , Iterable<LongWritable> values, Context context)
+ protected void reduce(TextLong tuple, Iterable<LongWritable> values, Context context)
throws IOException ,InterruptedException {
long sum = 0L; //sum up the values
@@ -130,23 +129,23 @@ public class LogAnalytics extends Config
/**
* Creates and returns the {@link Job} for submitting to Hadoop mapreduce.
- * @param dataStore
- * @param query
+ * @param inStore
+ * @param outStore
+ * @param numReducer
* @return
* @throws IOException
*/
- public Job createJob(DataStore<Long, Pageview> inStore
- , DataStore<String, MetricDatum> outStore, int numReducer) throws IOException {
+ public Job createJob(DataStore<Long, Pageview> inStore,
+ DataStore<String, MetricDatum> outStore, int numReducer) throws IOException {
Job job = new Job(getConf());
-
job.setJobName("Log Analytics");
job.setNumReduceTasks(numReducer);
job.setJarByClass(getClass());
/* Mappers are initialized with GoraMapper.initMapper() or
* GoraInputFormat.setInput()*/
- GoraMapper.initMapperJob(job, inStore, TextLong.class, LongWritable.class
- , LogAnalyticsMapper.class, true);
+ GoraMapper.initMapperJob(job, inStore, TextLong.class, LongWritable.class,
+ LogAnalyticsMapper.class, true);
/* Reducers are initialized with GoraReducer#initReducer().
* If the output is not to be persisted via Gora, any reducer
@@ -161,7 +160,7 @@ public class LogAnalytics extends Config
DataStore<Long, Pageview> inStore;
DataStore<String, MetricDatum> outStore;
- Configuration conf = new Configuration();
+ Configuration conf = new Configuration();
if(args.length > 0) {
String dataStoreClass = args[0];
@@ -171,11 +170,10 @@ public class LogAnalytics extends Config
dataStoreClass = args[1];
}
outStore = DataStoreFactory.
- getDataStore(dataStoreClass,
- String.class, MetricDatum.class, conf);
+ getDataStore(dataStoreClass, String.class, MetricDatum.class, conf);
} else {
- inStore = DataStoreFactory.getDataStore(Long.class, Pageview.class, conf);
- outStore = DataStoreFactory.getDataStore(String.class, MetricDatum.class, conf);
+ inStore = DataStoreFactory.getDataStore(Long.class, Pageview.class, conf);
+ outStore = DataStoreFactory.getDataStore(String.class, MetricDatum.class, conf);
}
Job job = createJob(inStore, outStore, 3);
Propchange: gora/trunk/sources-dist/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 16 06:22:38 2012
@@ -0,0 +1,30 @@
+# 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.
+
+*~
+*.iml
+.idea
+.classpath
+.externalToolBuilders
+.project
+.settings
+.git
+.svn
+build
+dist
+lib
+**/lib/*.jar
+ivy/ivy*.jar
+target