[infinispan-issues] [JBoss JIRA] (ISPN-1103) Soft schema-based storage

Randall Hauch (Issue Comment Edited) (JIRA) jira-events at lists.jboss.org
Fri Oct 14 10:33:17 EDT 2011


    [ https://issues.jboss.org/browse/ISPN-1103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634871#comment-12634871 ] 

Randall Hauch edited comment on ISPN-1103 at 10/14/11 10:32 AM:
----------------------------------------------------------------

It's just using Infinispan's Map-Reduce functionality to validate each document using the JSON Schema referenced by the document. It should distribute just fine, because a) validation is dependent only upon the document (the value in Infinispan) itself and the schema registry, which can be serialized.

The {{SchematicDb.validateAll()}} is the method that uses Infinispan Map-Reduce and is [here|https://github.com/rhauch/infinispan/blob/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/internal/CacheSchematicDb.java#L117], with the Mapper implementation [here|https://github.com/rhauch/infinispan/blob/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/internal/DocumentValidationMapper.java] and the Reducer implementation [here|https://github.com/rhauch/infinispan/blob/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/internal/DocumentValidationReducer.java].

The Reducer spits out [validation result|https://github.com/rhauch/infinispan/blob/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/SchemaLibrary.java#L53] objects, which contain the validation errors, warnings, and information messages. That means that the collector will have a Results object for each document key.
                
      was (Author: rhauch):
    It's just using Infinispan's Map-Reduce functionality to validate each document using the JSON Schema referenced by the document. It should distribute just fine, because a) validation is dependent only upon the document (the value in Infinispan) itself and the schema registry, which can be serialized.

The {{SchematicDb.validateAll()}} is the method that uses Infinispan Map-Reduce and is [here|https://github.com/rhauch/infinispan/blob/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/internal/CacheSchematicDb.java#L117], with the Mapper implementation [here|https://github.com/rhauch/infinispan/blob/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/internal/DocumentValidationMapper.java] and the Reducer implementation [here|https://github.com/rhauch/infinispan/blob/ISPN-1103/schematic/src/main/java/org/infinispan/schematic/internal/DocumentValidationReducer.java].
                  
> Soft schema-based storage
> -------------------------
>
>                 Key: ISPN-1103
>                 URL: https://issues.jboss.org/browse/ISPN-1103
>             Project: Infinispan
>          Issue Type: Feature Request
>          Components: Core API
>            Reporter: Manik Surtani
>            Assignee: Randall Hauch
>            Priority: Critical
>             Fix For: 5.1.0.BETA2, 5.1.0.FINAL
>
>
> This JIRA is about storing metadata alongside values.  Perhaps encapsulating values as SchematicValues, which could be described as:
> {code}
>   class SchematicValue {
>     String jsonMetadata;
>     String jsonObject;
>   }
> {code}
> Metadata would allow for a few interesting features:
> * Extracting of lifespan and timestamp data if manipulated over a remote protocol (REST, HotRod, etc)
> * Content type for REST responses
> * Timestamps and SHA-1 hashes, useful for for HTTP headers (e.g., ETag, Cache-control, etc.)
> * Validation information (may not be processed by Infinispan, but can be used by client libs)
> * Classloader/marshaller/classdef version info
> * General structure of the information stored
> * Reference to the schema for this document
> * Storage of older versions

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list