gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lewis John McGibbney (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GORA-266) Lucene datastore for Gora
Date Wed, 06 Aug 2014 03:56:12 GMT

    [ https://issues.apache.org/jira/browse/GORA-266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14087209#comment-14087209
] 

Lewis John McGibbney commented on GORA-266:
-------------------------------------------

Hi [~sstults], thanks for reuploading this. I am getting ClassCastException's for many tests
when I attempt to run the test suite on the module.
The Exception is raised at the bottom line within LuceneStore#put method

+  @Override
+  public void put(K key, T persistent) {
+    Schema schema = persistent.getSchema();
+    Document doc = new Document();
+
+    // populate the doc
+    List<org.apache.avro.Schema.Field> fields = schema.getFields();
+    for ( org.apache.avro.Schema.Field field : fields ) {
+      if (!persistent.isDirty( field.name() )) {
+        continue;
+      }
+      String sf = mapping.getLuceneField( field.name() );
+      if ( sf == null ) {
+        continue;
+      }
+      Schema fieldSchema = field.schema();
+      Object v = persistent.get( field.pos() );
+      if ( v == null ) {
+        continue;
+      }
+      switch ( fieldSchema.getType() ) {
+        case MAP:   //TODO: These should be handled better
+        case ARRAY:
+        case RECORD:
+        case UNION:
+          // For now we'll just store the bytes
+          byte[] data = new byte[0];
+          try {
+            data = IOUtils.serialize( datumWriter, fieldSchema, (T) v);

> Lucene datastore for Gora
> -------------------------
>
>                 Key: GORA-266
>                 URL: https://issues.apache.org/jira/browse/GORA-266
>             Project: Apache Gora
>          Issue Type: New Feature
>          Components: gora-lucene
>            Reporter: Lewis John McGibbney
>            Assignee: Scott Stults
>            Priority: Minor
>              Labels: features
>             Fix For: 0.6
>
>         Attachments: GORA-266.patch
>
>
> Sometimes we don't need to set up, administer, maintain and configure a running solr
server(s).
> Sometime we just want to write to Lucene index files and read directly from them. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message