You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gora.apache.org by le...@apache.org on 2014/04/03 21:37:50 UTC
svn commit: r1584344 - in /gora/branches/GORA_94: ./
gora-core/src/examples/java/org/apache/gora/examples/generated/
gora-core/src/test/java/org/apache/gora/store/ gora-solr/
gora-solr/src/main/java/org/apache/gora/solr/store/
Author: lewismc
Date: Thu Apr 3 19:37:49 2014
New Revision: 1584344
URL: http://svn.apache.org/r1584344
Log:
GORA-303v2 Upgrade to Avro 1.7.X in gora-solr
Modified:
gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java
gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
gora/branches/GORA_94/gora-solr/pom.xml
gora/branches/GORA_94/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
gora/branches/GORA_94/pom.xml
Modified: gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java?rev=1584344&r1=1584343&r2=1584344&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java (original)
+++ gora/branches/GORA_94/gora-core/src/examples/java/org/apache/gora/examples/generated/Employee.java Thu Apr 3 19:37:49 2014
@@ -88,7 +88,6 @@ public class Employee extends org.apache
}
// Used by DatumReader. Applications should not call.
- @SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value) {
switch (field$) {
case 0: __g__dirty = (java.nio.ByteBuffer)(value); break;
Modified: gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java?rev=1584344&r1=1584343&r2=1584344&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java (original)
+++ gora/branches/GORA_94/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java Thu Apr 3 19:37:49 2014
@@ -57,8 +57,6 @@ import org.apache.gora.util.AvroUtils;
import org.apache.gora.util.ByteUtils;
import org.apache.gora.util.StringUtils;
-import com.sun.istack.logging.Logger;
-
/**
* Test utilities for DataStores. This utility class provides everything
* necessary for convenience tests in {@link DataStoreTestBase} to execute cleanly.
Modified: gora/branches/GORA_94/gora-solr/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-solr/pom.xml?rev=1584344&r1=1584343&r2=1584344&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-solr/pom.xml (original)
+++ gora/branches/GORA_94/gora-solr/pom.xml Thu Apr 3 19:37:49 2014
@@ -142,6 +142,12 @@
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.restlet.jee</groupId>
+ <artifactId>org.restlet.ext.servlet</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
@@ -188,17 +194,30 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty.orbit</groupId>
+ <artifactId>javax.servlet</artifactId>
+ </exclusion>
+ </exclusions>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
- <scope>compile</scope>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
- <scope>compile</scope>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- ADDED TO AVOID PROBLEMS WITH JAVAX -->
+ <dependency>
+ <groupId>javax</groupId>
+ <artifactId>javaee-api</artifactId>
+ <version>7.0</version>
</dependency>
<!-- Testing Dependencies -->
@@ -210,6 +229,12 @@
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-test-framework</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ </exclusion>
+ </exclusions>
<scope>test</scope>
</dependency>
<dependency>
Modified: gora/branches/GORA_94/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java?rev=1584344&r1=1584343&r2=1584344&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java (original)
+++ gora/branches/GORA_94/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java Thu Apr 3 19:37:49 2014
@@ -29,7 +29,6 @@ import org.apache.avro.Schema.Type;
import org.apache.avro.specific.SpecificDatumReader;
import org.apache.avro.specific.SpecificDatumWriter;
import org.apache.avro.util.Utf8;
-import org.apache.commons.lang.ArrayUtils;
import org.apache.gora.persistency.Persistent;
import org.apache.gora.persistency.impl.PersistentBase;
import org.apache.gora.query.PartitionQuery;
@@ -387,6 +386,7 @@ public class SolrStore<K, T extends Pers
return writer;
}
+ @SuppressWarnings("unchecked")
private Object deserializeFieldValue(Field field, Schema fieldSchema,
Object solrValue, T persistent) throws IOException {
Object fieldValue = null;
@@ -394,6 +394,7 @@ public class SolrStore<K, T extends Pers
case MAP:
case ARRAY:
case RECORD:
+ @SuppressWarnings("rawtypes")
SpecificDatumReader reader = getDatumReader(fieldSchema.getFullName(),
fieldSchema);
fieldValue = IOUtils.deserialize((byte[]) solrValue, reader, fieldSchema,
@@ -430,6 +431,7 @@ public class SolrStore<K, T extends Pers
fieldValue = deserializeFieldValue(field, fieldSchema, solrValue,
persistent);
} else {
+ @SuppressWarnings("rawtypes")
SpecificDatumReader unionReader = getDatumReader(
String.valueOf(fieldSchema.hashCode()), fieldSchema);
fieldValue = IOUtils.deserialize((byte[]) solrValue, unionReader,
@@ -483,6 +485,7 @@ public class SolrStore<K, T extends Pers
}
}
+ @SuppressWarnings("unchecked")
private Object serializeFieldValue(Schema fieldSchema, Object fieldValue) {
switch (fieldSchema.getType()) {
case MAP:
@@ -490,6 +493,7 @@ public class SolrStore<K, T extends Pers
case RECORD:
byte[] data = null;
try {
+ @SuppressWarnings("rawtypes")
SpecificDatumWriter writer = getDatumWriter(fieldSchema.getFullName(),
fieldSchema);
data = IOUtils.serialize(writer, fieldSchema, fieldValue);
@@ -506,8 +510,8 @@ public class SolrStore<K, T extends Pers
fieldValue = fieldValue.toString();
break;
case UNION:
- // TODO: If field's schema is null and one type, We do not serialization.
- // Other all types serialize.
+ // If field's schema is null and one type, we do undertake serialization.
+ // All other types are serialized.
if (fieldSchema.getTypes().size() == 2 && isNullable(fieldSchema)) {
int schemaPos = getUnionSchema(fieldValue, fieldSchema);
Schema unionSchema = fieldSchema.getTypes().get(schemaPos);
@@ -515,6 +519,7 @@ public class SolrStore<K, T extends Pers
} else {
byte[] serilazeData = null;
try {
+ @SuppressWarnings("rawtypes")
SpecificDatumWriter writer = getDatumWriter(
String.valueOf(fieldSchema.hashCode()), fieldSchema);
serilazeData = IOUtils.serialize(writer, fieldSchema, fieldValue);
Modified: gora/branches/GORA_94/pom.xml
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/pom.xml?rev=1584344&r1=1584343&r2=1584344&view=diff
==============================================================================
--- gora/branches/GORA_94/pom.xml (original)
+++ gora/branches/GORA_94/pom.xml Thu Apr 3 19:37:49 2014
@@ -604,7 +604,7 @@
<!-- Solr Dependencies -->
<lucene-solr.version>4.3.0</lucene-solr.version>
<solr-solrj.version>4.3.0</solr-solrj.version>
- <jetty.version>8.1.10.v20130312</jetty.version>
+ <jetty.version>8.1.8.v20121106</jetty.version>
<slf4j.version>1.6.6</slf4j.version>
<log4j.version>1.2.16</log4j.version>
<tika.version>1.3</tika.version>
@@ -880,8 +880,8 @@
<scope>test</scope>
<exclusions>
<exclusion>
- <groupId>org.apache.cassandra.deps</groupId>
- <artifactId>avro</artifactId>
+ <groupId>org.apache.cassandra.deps</groupId>
+ <artifactId>avro</artifactId>
</exclusion>
</exclusions>
</dependency>
@@ -897,11 +897,11 @@
<artifactId>hector-core</artifactId>
<version>${hector.version}</version>
<exclusions>
- <exclusion>
- <groupId>org.apache.cassandra</groupId>
- <artifactId>cassandra-all</artifactId>
- </exclusion>
- </exclusions>
+ <exclusion>
+ <groupId>org.apache.cassandra</groupId>
+ <artifactId>cassandra-all</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!-- Solr Dependencies -->