http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-indexing-sql.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-indexing-sql.html b/content/java/develop/extension-indexing-sql.html new file mode 100644 index 0000000..c2e5b2f --- /dev/null +++ b/content/java/develop/extension-indexing-sql.html @@ -0,0 +1,136 @@ + +SQL Index/Query + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

SQL Index/Query

code

docs

tests

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:

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 Index/Query 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 Index/Query assembly. Remember to configure +the DataSource properly, see SQL Library and Configure a Service.

PostgreSQL

Assembly is done using the provided Assembler:

// DataSourceService
+new DBCPDataSourceServiceAssembler().
+    identifiedBy( "postgres-datasource-service" ).
+    visibleIn( Visibility.module ).
+    withConfig( config, Visibility.layer ).
+    assemble( mainModule );
+
+// DataSource
+new DataSourceAssembler().
+    withDataSourceServiceIdentity( "postgres-datasource-service" ).
+    identifiedBy( "postgres-datasource" ).
+    visibleIn( Visibility.module ).
+    withCircuitBreaker().
+    assemble( mainModule );
+
+// SQL Index/Query
+new PostgreSQLIndexQueryAssembler().
+    visibleIn( Visibility.module ).
+    withConfig( config, Visibility.layer ).
+    assemble( mainModule );
+

Sample DataSource configuration defaults:

#
+#  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.
+#
+#
+#
+
+enabled=true
+url=jdbc:postgresql://localhost:5432/jdbc_test_db
+driver=org.postgresql.Driver
+username=jdbc_test_login
+password=password

Important

The PostgreSQL ltree extension is needed on the used database, see below how to install it on your database.

Installing ltree on PostgreSQL >= 9.1 ==

It’s bundled with PostgreSQL but you need to activate it on your database:

CREATE EXTENSION ltree;
Installing ltree on PostgreSQL ⇐ 9.0

You need to install postgresql-contrib and import the module in your database. +The following applies to Debian based distributions, adapt it to yours:

  1. +Install the contrib package: sudo apt-get install postgresql-contrib +
  2. +Restart the database: sudo /etc/init.d/postgresql-8.4 restart +
  3. +Change to the database owner account (e.g., postgres). +
  4. +Change to the contrib modules' directory: /usr/share/postgresql/8.4/contrib/ +
  5. +Load the SQL files using: psql -U user_name -d database_name -f module_name.sql +

For example to install the needed ltree module:

psql -U postgres -d database_name -f ltree.sql
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-metrics-metrics.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-metrics-metrics.html b/content/java/develop/extension-metrics-metrics.html new file mode 100644 index 0000000..4b93253 --- /dev/null +++ b/content/java/develop/extension-metrics-metrics.html @@ -0,0 +1,82 @@ + +Codahale Metrics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

Codahale Metrics

code

docs

tests

Metrics extension backed by the Codahale metrics library +maintained by the Dropwizard folks.

Assembly

Assembly is done using the provided Assembler:

return new CodahaleMetricsAssembler();
+

Reporting to Ganglia or Graphite

Dropwizard provide metrics reporter for Ganglia or Graphite, see the official documentation +for details.

To register reporters you need a handle to the underlying MetricsRegistry, the CodahaleMetricsProvider service +provide accessor to it:

CodahaleMetricsProvider metricsProvider = module.findService( CodahaleMetricsProvider.class ).get();
+  [...snip...]
+
+        MetricRegistry metricRegistry = metricsProvider.metricRegistry();
+
\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-migration.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-migration.html b/content/java/develop/extension-migration.html new file mode 100644 index 0000000..9d83a89 --- /dev/null +++ b/content/java/develop/extension-migration.html @@ -0,0 +1,74 @@ + +Migration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

Migration

code

docs

tests

Migration

Note

This Extension has no documentation yet. Learn how to contribute in Writing Documentation.

\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-reindexer.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-reindexer.html b/content/java/develop/extension-reindexer.html new file mode 100644 index 0000000..e95d7f5 --- /dev/null +++ b/content/java/develop/extension-reindexer.html @@ -0,0 +1,89 @@ + +Reindexer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

Reindexer

code

docs

tests

This extension allows you to trigger a complete indexing of EntityStores into Index/Query systems.

The Reindexer is totally under your control and doesn’t kick in automatically in any way or form.

module.services( ReindexerService.class );
+

It will be bound to the EntityStore that is Visible, ask for all Entities, by calling +entityStates() and forward those to all StateChangeListeners that are Visible.

Reindexer reindexer = serviceFinder.findService( Reindexer.class ).get();
+reindexer.reindex();
+

So, you call reindex() on the Reindexer. If you have many reindexers, you could call +reindexAll() which will locate all reindexers and call reindex() +on each. This is useful when there are many modules of entity stores.

There are two general issues that you need to keep in mind;

  1. +Not all entity stores implements entityStates(), mostly because the + underlying store doesn’t provide a convenient mechanism to iterate + everything. +
  2. +Unless you first clear all in the Index, deletions will not be + detected, and therefor the index might contain to many entity references in + that case. +

Additionally, reindexing is not really thread safe, so need to bring the +system down while reindexing is happening.

\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-vs-jackson.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-vs-jackson.html b/content/java/develop/extension-vs-jackson.html new file mode 100644 index 0000000..c0e0b0f --- /dev/null +++ b/content/java/develop/extension-vs-jackson.html @@ -0,0 +1,84 @@ + +Jackson ValueSerialization + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

Jackson ValueSerialization

code

docs

tests

ValueSeriali zation Service backed by Jackson.

Assembly

Assembly is done as follows:

@Override
+public void assemble( ModuleAssembly module )
+    throws AssemblyException
+{
+    new JacksonValueSerializationAssembler().assemble( module );
+      [...snip...]
+
+    super.assemble( module );
+}
+

See the ValueSerialization API and SPI documentation for details and +usage.

\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-vs-orgjson.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-vs-orgjson.html b/content/java/develop/extension-vs-orgjson.html new file mode 100644 index 0000000..4ea3799 --- /dev/null +++ b/content/java/develop/extension-vs-orgjson.html @@ -0,0 +1,83 @@ + +org.json ValueSerialization + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

org.json ValueSerialization

code

docs

tests

ValueSer ialization Service backed by org.json.

Assembly

Assembly is done as follows:

@Override
+public void assemble( ModuleAssembly module )
+    throws AssemblyException
+{
+    new OrgJsonValueSerializationAssembler().assemble( module );
+      [...snip...]
+
+}
+

See the ValueSerialization API and SPI documentation for details and +usage.

\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-vs-stax.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-vs-stax.html b/content/java/develop/extension-vs-stax.html new file mode 100644 index 0000000..76cf348 --- /dev/null +++ b/content/java/develop/extension-vs-stax.html @@ -0,0 +1,83 @@ + +StAX ValueSerialization + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

StAX ValueSerialization

code

docs

tests

ValueSerialization Se rvice backed by StAX.

Assembly

Assembly is done as follows:

@Override
+public void assemble( ModuleAssembly module )
+    throws AssemblyException
+{
+    new StaxValueSerializationAssembler().assemble( module );
+      [...snip...]
+
+}
+

See the ValueSerialization API and SPI documentation for details and +usage.

\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extensions.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extensions.html b/content/java/develop/extensions.html new file mode 100644 index 0000000..be274cb --- /dev/null +++ b/content/java/develop/extensions.html @@ -0,0 +1,94 @@ + +Extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Polygene™
Introduction
Tutorials
Javadoc
Samples
Core
Libraries
Extensions
Tools
Glossary 

Extensions

Overview

We try to keep the Polygene™ Core Runtime as lean as possible, and a lot of the power to th e Polygene™ Platform comes via its +Extension SPI, which defines clear ways to extend the platform. There are currently the following Extensions types, +each with possibly more than one implementation;

  • +Value Serialization +
  • +Entity Stores +
  • +Index / Query Engines +
  • +Entity Caches +
  • +Metrics Gathering +
  • +Reindexing +
  • +Migration +

This section will go through each of the available extensions. +The Polygene™ Extensions are of varying maturity level and we try to maintain a STATUS (dev-status.xml) file indicating +how good the codebase, documentation and unit tests are for each of the libraries. This is highly subjective and +potentially different individuals will judge this differently, but at least it gives a ballpark idea of the situation +for our users.

\ No newline at end of file