Check out some of features that we have opened up to the community. To learn more about XAP features, continue reading our documentation and check out the XAP code examples.
Scale your data tier by partitioning or replicating across an in-memory data grid.
Implement event-driven architecture workloads at microsecond latencies.
Apply SQL query semantics against POJOs, Documents, and GeoSpatial data.
Maintain full ACID compliance against your data set through full transaction semantics.
Leverage in-memory Map/Reduce patterns as well as ultra-low latency remoting for high-throughput processing.
Persist your data using highly-avaialble asynchronous write behind patterns to relational and NoSQL data stores.
You need somewhere to start. Check out the code below to build your first data grid.
package org.gigaspaces.xap.demo;
import org.openspaces.core.GigaSpace;
import org.openspaces.core.GigaSpaceConfigurer;
import org.openspaces.core.space.SpaceProxyConfigurer;
public class Program {
public static void main(String[] args) {
System.out.println("Connecting to data grid");
SpaceProxyConfigurer configurer = new SpaceProxyConfigurer("myGrid");
GigaSpace gigaSpace = new GigaSpaceConfigurer(configurer).create();
}
}
public class MyDistTask implements DistributedTask {
public Integer execute() throws Exception {
return 1;
}
public Long reduce(List> results) throws Exception {
long sum = 0;
for (AsyncResult result : results) {
if (result.getException() != null) {
throw result.getException();
}
sum += result.getResult();
}
return sum;
}
}
XAP supports Task execution in an asynchronous manner, collocated with the Space. Tasks can be executed directly on a specific cluster member using routing declarations. Tasks can also be executed in “broadcast” mode on all the primary cluster members concurrently and reduced to a single result on the client-side.
Continue reading...
@EventDriven @Polling
public class SimpleListener {
@EventTemplate
Data unprocessedData() {
Data template = new Data();
template.setProcessed(false);
return template;
}
@SpaceDataEvent
public Data eventListener(Data event) {
//process Data here
}
}
The polling event container is an implementation of the polling consumer pattern which uses the space to receive events. It performs polling receive operations against the space. A polling event operation is mainly used when simulating Queue semantics or when using the master-worker design pattern.
Continue reading...
public class MySpaceSynchronizationEndpoint extends SpaceSynchronizationEndpoint {
@Override
public void onOperationsBatchSynchronization(OperationsBatchData batchData) {
// Get operations in batch
DataSyncOperation[] operations = batchData.getBatchDataItems();
for (DataSyncOperation operation : operations) {
switch (operation.getDataSyncOperationType()) {
case WRITE:
// INSERT to SQL
break;
case UPDATE:
// UPDATE to SQL
break;
default:
System.out.println(operation.getDataSyncOperationType() + " operation");
}
}
}
}
The Space Persistency is made of two components, A space data source and a space synchronization endpoint. These components provide advanced persistency capabilities for the space architecture to interact with a persistency layer.
Continue reading...Checkout the files that you'll see upon downloading
Once you download the Open Source edition, you can see a folder with several files and sub folders. Check out the tree below to see which files are relevant for you.
Please reach out if you'd like to get involved in the XAP community
We welcome contributions and feature proposals from the community. All comitters should sign a Contributor License Agreement before submitting a pull request to us over GitHub. For more information, please consult the CONTRIBUTING.md guidelines
The XAP Open Source edition source code is available under the XAP GitHub Repository along with the associated build scripts. All code is available under the Apache 2 license.
Join thousands of XAP developers, customers and users to have your XAP questions answered at http://ask.gigaspaces.org
Interested in a commercial edition of the product? You can download a trial version of the XAP Premium and Enterprise edition to test drive additional features in the grid.