Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2A34A200C7C for ; Sun, 21 May 2017 17:05:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 28C5E160BC5; Sun, 21 May 2017 15:05:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 07E6B160BDC for ; Sun, 21 May 2017 17:05:44 +0200 (CEST) Received: (qmail 25741 invoked by uid 500); 21 May 2017 15:05:44 -0000 Mailing-List: contact commits-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list commits@polygene.apache.org Received: (qmail 25059 invoked by uid 99); 21 May 2017 15:05:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 May 2017 15:05:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9FD68E027A; Sun, 21 May 2017 15:05:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: paulmerlin@apache.org To: commits@polygene.apache.org Date: Sun, 21 May 2017 15:06:22 -0000 Message-Id: <0a9da0a18e9f46bb87091260d051b191@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [45/51] [partial] polygene-website git commit: Update java/develop/ archived-at: Sun, 21 May 2017 15:05:48 -0000 http://git-wip-us.apache.org/repos/asf/polygene-website/blob/51abe7dd/content/java/develop/extension-es-sql.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-es-sql.html b/content/java/develop/extension-es-sql.html index a277f1c..0603e3b 100644 --- a/content/java/develop/extension-es-sql.html +++ b/content/java/develop/extension-es-sql.html @@ -1,5 +1,5 @@ -SQL EntityStore +SQL EntityStore @@ -66,9 +66,9 @@ })(); -

SQL EntityStore

code

docs

tests

EntityStore service backed by a SQL data base.

This extension fully leverage the SQL Library meaning that you must use it to assemble your DataSource and that you -get Circuit Breaker and JMX integration for free.

Tip

See the SQL Support Sample that demonstrate combined use of SQL Library, SQL EntityStore and -SQL Index/Query.

The following SQL databases are supported:

  • +

    SQL EntityStore

    code

    docs

    tests

    E ntityStore service backed by a SQL database.

    This extension fully leverage the SQL Library meaning that you must use it to assemble your DataSource and that you +get Circuit Breaker and JMX integration for free.

    The database schema is managed using ???.

    Tip

    See the SQL Support Sample that demonstrate combined use of SQL Library, SQL EntityStore and +SQL Index/Query.

    The following SQL databases are supported:

    Each entity state is stored as a single row so maximum number of entities is the maximum number of rows per table -supported by the underlying SQL database.

    Implementations per database Vendor share a generic codebase but can override about everything SQL. As a consequence -they can have strong differences in terms of performance if they use vendor specific extensions.

    Configuration

    SQL EntityStore Configuration is optional and provides only one configuration property: schemaName defaulted to -polygene_es. On SQL databases that don’t support schemas this configuration property is simply ignored.

    The assembly snippets below show the DataSource assembly alongside the SQL EntityStore assembly. Remember to configure -the DataSource properly, see SQL Library and Configure a Service.

    PostgreSQL

    Maximum number of entities is unlimited.

    Assembly is done using the provided Assembler:

    public void assemble( ModuleAssembly module )
    +supported by the underlying SQL database.

    Table 62. Artifact

    Group IDArtifact IDVersion

    org.apache.polygene.extensions

    org.apache.polygene.extension.entitystore-sql

    3.0.0-SNAPSHOT


    Configuration

    Here are the available configuration properties:

    public inte
     rface SQLMapEntityStoreConfiguration extends SQLConfiguration
    +{
    +    /**
    +     * Name of the database schema to use.
    +     * Ignored on SQL databases that don't support schemas.
    +     */
    +    @UseDefaults( "POLYGENE_ES" )
    +    @Override
    +    Property<String> schemaName();
    +
    +    /**
    +     * Name of the entities table.
    +     */
    +    @UseDefaults( "POLYGENE_ENTITIES" )
    +    Property<String> entityTableName();
    +
    +    /**
    +     * Defines whether the database schema and table should be created if not already present.
    +     */
    +    @UseDefaults( "true" )
    +    Property<Boolean> createIfMissing();
    +}
    +

    The assembly snippets below show the DataSource assembly alongside the SQL EntityStore assembly. Remember to configure +the DataSource properly, see SQL Library and Configure a Service.

    PostgreSQL

    Maximum number of entities is unlimited.

    Assembly is done using the provided Assembler:

    public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
       [...snip...]
     
         // DataSourceService
    -    new DBCPDataSourceServiceAssembler().
    -        identifiedBy( "postgresql-datasource-service" ).
    -        visibleIn( Visibility.module ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new DBCPDataSourceServiceAssembler()
    +        .identifiedBy( "postgresql-datasource-service" )
    +        .visibleIn( Visibility.module )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
     
         // DataSource
    -    new DataSourceAssembler().
    -        withDataSourceServiceIdentity( "postgresql-datasource-service" ).
    -        identifiedBy( "postgresql-datasource" ).
    -        visibleIn( Visibility.module ).
    -        withCircuitBreaker().
    -        assemble( module );
    +    new DataSourceAssembler()
    +        .withDataSourceServiceIdentity( "postgresql-datasource-service" )
    +        .identifiedBy( "postgresql-datasource" )
    +        .visibleIn( Visibility.module )
    +        .withCircuitBreaker()
    +        .assemble( module );
     
         // SQL EntityStore
    -    new PostgreSQLEntityStoreAssembler().
    -        visibleIn( Visibility.application ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new PostgreSQLEntityStoreAssembler()
    +        .visibleIn( Visibility.application )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
               [...snip...]
     
     }
    @@ -133,31 +153,31 @@ the DataSource properly, see 

    MySQL and MariaDB

    Maximum number of entities depends on the choosen storage engine.

    Assembly is done using the provided Assembler:

    public void assemble( ModuleAssembly module )
    +password=password

    MySQL and MariaDB

    Maximum number of entities depends on the choosen storage engine.

    Assembly is done using the provided Assembler:

    public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
       [...snip...]
     
         // DataSourceService
    -    new DBCPDataSourceServiceAssembler().
    -        identifiedBy( "mysql-datasource-service" ).
    -        visibleIn( Visibility.module ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new DBCPDataSourceServiceAssembler()
    +        .identifiedBy( "mysql-datasource-service" )
    +        .visibleIn( Visibility.module )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
     
         // DataSource
    -    new DataSourceAssembler().
    -        withDataSourceServiceIdentity( "mysql-datasource-service" ).
    -        identifiedBy( "mysql-datasource" ).
    -        visibleIn( Visibility.module ).
    -        withCircuitBreaker().
    -        assemble( module );
    +    new DataSourceAssembler()
    +        .withDataSourceServiceIdentity( "mysql-datasource-service" )
    +        .identifiedBy( "mysql-datasource" )
    +        .visibleIn( Visibility.module )
    +        .withCircuitBreaker()
    +        .assemble( module );
     
         // SQL EntityStore
    -    new MySQLEntityStoreAssembler().
    -        visibleIn( Visibility.application ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new MySQLEntityStoreAssembler()
    +        .visibleIn( Visibility.application )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
               [...snip...]
     
     }
    @@ -182,35 +202,35 @@ password=password

    SQLite

    Maximum number of entities is unlimited.

    The Xerial SQLite JDBC driver is recommended. +password=

    SQLite

    Maximum number of entities is unlimited.

    The Xerial SQLite JDBC driver is recommended. It provides native support on Linux, Windows and MaxOSX, pure Java on other OSes.

    Assembly is done using the provided Assembler:

    public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
       [...snip...]
     
         // DataSourceService
    -    new DBCPDataSourceServiceAssembler().
    -        identifiedBy( "sqlite-datasource-service" ).
    -        visibleIn( Visibility.module ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new DBCPDataSourceServiceAssembler()
    +        .identifiedBy( "sqlite-datasource-service" )
    +        .visibleIn( Visibility.module )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
     
         // DataSource
    -    new DataSourceAssembler().
    -        withDataSourceServiceIdentity( "sqlite-datasource-service" ).
    -        identifiedBy( "sqlite-datasource" ).
    -        visibleIn( Visibility.module ).
    -        withCircuitBreaker().
    -        assemble( module );
    +    new DataSourceAssembler()
    +        .withDataSourceServiceIdentity( "sqlite-datasource-service" )
    +        .identifiedBy( "sqlite-datasource" )
    +        .visibleIn( Visibility.module )
    +        .withCircuitBreaker()
    +        .assemble( module );
     
         // SQL EntityStore
    -    new SQLiteEntityStoreAssembler().
    -        visibleIn( Visibility.application ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new SQLiteEntityStoreAssembler()
    +        .visibleIn( Visibility.application )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
     }
     

    Sample DataSource configuration defaults:

    #
     #  Licensed to the Apache Software Foundation (ASF) under one
    @@ -236,31 +256,31 @@ enabled=true
     url=jdbc:sqlite::memory:
     driver=org.sqlite.JDBC
     username=
    -password=

    H2 Database Engine

    Maximum number of entities is 2^64.

    Assembly is done using the provided Assembler:

    public void assemble( ModuleAssembly module )
    +password=

    H2 Database Engine

    Maximum number of entities is 2^64.

    Assembly is done using the provided Assembler:

    public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
       [...snip...]
     
         // DataSourceService
    -    new DBCPDataSourceServiceAssembler().
    -        identifiedBy( "h2-datasource-service" ).
    -        visibleIn( Visibility.module ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new DBCPDataSourceServiceAssembler()
    +        .identifiedBy( "h2-datasource-service" )
    +        .visibleIn( Visibility.module )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
     
         // DataSource
    -    new DataSourceAssembler().
    -        withDataSourceServiceIdentity( "h2-datasource-service" ).
    -        identifiedBy( "h2-datasource" ).
    -        visibleIn( Visibility.module ).
    -        withCircuitBreaker().
    -        assemble( module );
    +    new DataSourceAssembler()
    +        .withDataSourceServiceIdentity( "h2-datasource-service" )
    +        .identifiedBy( "h2-datasource" )
    +        .visibleIn( Visibility.module )
    +        .withCircuitBreaker()
    +        .assemble( module );
     
         // SQL EntityStore
    -    new H2SQLEntityStoreAssembler().
    -        visibleIn( Visibility.application ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new H2SQLEntityStoreAssembler()
    +        .visibleIn( Visibility.application )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
     }
     

    Sample DataSource configuration defaults:

    #
     #  Licensed to the Apache Software Foundation (ASF) under one
    @@ -286,31 +306,31 @@ enabled=true
     url=jdbc:h2:mem:test
     driver=org.h2.Driver
     username=
    -password=

    Apache Derby and Oracle JavaDB

    Maximum number of entities is unlimited.

    Assembly is done using the provided Assembler:

    public void assemble( ModuleAssembly module )
    +password=

    Apache Derby and Oracle JavaDB

    Maximum number of entities is unlimited.

    Assembly is done using the provided Assembler:

    public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
       [...snip...]
     
         // DataSourceService
    -    new DBCPDataSourceServiceAssembler().
    -        identifiedBy( "derby-datasource-service" ).
    -        visibleIn( Visibility.module ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new DBCPDataSourceServiceAssembler()
    +        .identifiedBy( "derby-datasource-service" )
    +        .visibleIn( Visibility.module )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
     
         // DataSource
    -    new DataSourceAssembler().
    -        withDataSourceServiceIdentity( "derby-datasource-service" ).
    -        identifiedBy( "derby-datasource" ).
    -        visibleIn( Visibility.module ).
    -        withCircuitBreaker().
    -        assemble( module );
    +    new DataSourceAssembler()
    +        .withDataSourceServiceIdentity( "derby-datasource-service" )
    +        .identifiedBy( "derby-datasource" )
    +        .visibleIn( Visibility.module )
    +        .withCircuitBreaker()
    +        .assemble( module );
     
         // SQL EntityStore
    -    new DerbySQLEntityStoreAssembler().
    -        visibleIn( Visibility.application ).
    -        withConfig( config, Visibility.layer ).
    -        assemble( module );
    +    new DerbySQLEntityStoreAssembler()
    +        .visibleIn( Visibility.application )
    +        .withConfig( config, Visibility.layer )
    +        .assemble( module );
     }
     

    Sample DataSource configuration defaults:

    #
     #  Licensed to the Apache Software Foundation (ASF) under one
    
    http://git-wip-us.apache.org/repos/asf/polygene-website/blob/51abe7dd/content/java/develop/extension-index-elasticsearch.html
    ----------------------------------------------------------------------
    diff --git a/content/java/develop/extension-index-elasticsearch.html b/content/java/develop/extension-index-elasticsearch.html
    index 3b20faa..045493f 100644
    --- a/content/java/develop/extension-index-elasticsearch.html
    +++ b/content/java/develop/extension-index-elasticsearch.html
    @@ -1,5 +1,5 @@
     
    -ElasticSearch Index/Query
    +ElasticSearch Index/Query
     
     
     
    @@ -66,8 +66,8 @@
       })();
      
     
    -  

    ElasticSearch Index/Query

    code

    docs

    tests

    Index/Que ry services backed by ElasticSearch search engine built on top of -Apache Lucene.

    Warning

    ElasticSearch Index/Query do not support ComplexQueries from the Query API, ie. queries by "example value".

    Three modes of operation are supported:

    Configuration

    Important

    By default queries can only traverse Aggregated Associations, if you want to be able to traverse all Associations set the indexNonAggregatedAssociations configuration property to TRUE.

    Here are the configuration properties for the filesystem ElasticSearch Index/Query services:

    public interface ElasticSearchConfiguration
    -        extends ConfigurationComposite
     {
     
         /**
    @@ -106,10 +105,10 @@ Associations set the indexNonAggregatedAssociations
     
     }
     

    All configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without -configuration.

    In an ElasticSearch cluster

    Assembly

    Assembly is done using the provided Assembler:

    new ESClusterIndexQueryAssembler()
    +configuration.

    In an ElasticSearch cluster

    Assembly

    Assembly is done using the provided Assembler:

    new ESClusterIndexQueryAssembler()
         .withConfig( configModule, configVisibility )
         .assemble( module );
    -
    Configuration

    Here are the configuration properties for the clustered ElasticSearch Index/Query service. Note that it inherits the +

    Configuration

    Here are the configuration properties for the clustered ElasticSearch Index/Query service. Note that it inherits the properties defined in the filesystem configuration, see above.

    public interface ElasticSearchClusterConfiguration
             extends ElasticSearchConfiguration
     {
    @@ -148,16 +147,33 @@ properties defined in the filesystem configuration, see above.

    Using a provided client

    Assembly

    Assembly is done using the provided Assembler:

    new ESClientIndexQueryAssembler( client )
    +configuration.

    Using a provided client

    Assembly

    Assembly is done using the provided Assembler:

    new ESClientIndexQueryAssembler( client )
         .withConfig( configModule, configVisibility )
         .assemble( module );
    -
    Configuration

    Here are the configuration properties for the ElasticSearch Index/Query service using a provided client. -Note that the clusterName is ignored as this is managed by the client.

    Traceback (most recent call last):
    -  File "/Users/paul/.asciidoc/filters/snippet/snippet.py", line 100, in <module>
    -    for line in snippet(**configuration(indata)):
    -  File "/Users/paul/.asciidoc/filters/snippet/snippet.py", line 83, in snippet
    -    raise ValueError('Missing snippet for tag "' + tag + '" in file "' + source + '".')
    -ValueError: Missing snippet for tag "client" in file "extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchConfiguration.java".
    +
    Configuration

    Here are the configuration properties for the ElasticSearch Index/Query service using a provided client. +Note that the clusterName is ignored as this is managed by the client.

    public interface ElasticSearchConfiguration
    +{
    +
    +    /**
    +     * Cluster name.
    +     * Defaults to 'polygene_cluster'.
    +     */
    +    @Optional Property<String> clusterName();
    +
    +    /**
    +     * Index name.
    +     * Defaults to 'polygene_index'.
    +     */
    +    @Optional Property<String> index();
    +
    +    /**
    +     * Set to true to index non aggregated associations as if they were aggregated.
    +     * WARN: Don't use this if your domain model contains circular dependencies.
    +     * Defaults to 'FALSE'.
    +     */
    +    @UseDefaults Property<Boolean> indexNonAggregatedAssociations();
    +
    +}
     

    Again, all configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without configuration.