@IgniteSpiMultipleInstancesSupport(value=true) public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi, S3CheckpointSpiMBean
For information about Amazon S3 visit aws.amazon.com.
S3CheckpointSpi can be configured as follows:
IgniteConfiguration cfg = new IgniteConfiguration();
S3CheckpointSpi spi = new S3CheckpointSpi();
AWSCredentials cred = new BasicAWSCredentials(YOUR_ACCESS_KEY_ID, YOUR_SECRET_ACCESS_KEY);
spi.setAwsCredentials(cred);
spi.setBucketNameSuffix("checkpoints");
// Override default checkpoint SPI.
cfg.setCheckpointSpi(cpSpi);
// Start grid.
G.start(cfg);
S3CheckpointSpi can be configured from Spring XML configuration file:
<bean id="grid.custom.cfg" class="org.apache.ignite.configuration.IgniteConfiguration" singleton="true">
...
<property name="checkpointSpi">
<bean class="org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpi">
<property name="awsCredentials">
<bean class="com.amazonaws.auth.BasicAWSCredentials">
<constructor-arg value="YOUR_ACCESS_KEY_ID" />
<constructor-arg value="YOUR_SECRET_ACCESS_KEY" />
</bean>
</property>
</bean>
</property>
...
</bean>
Note that storing data in AWS S3 service will result in charges to your AWS account.
Choose another implementation of CheckpointSpi for local or
home network tests.
For information about Spring framework visit www.springframework.org
CheckpointSpi| Modifier and Type | Field and Description |
|---|---|
static String |
BUCKET_NAME_PREFIX
Prefix to use in bucket name generation.
|
static String |
DFLT_BUCKET_NAME_SUFFIX
Suffix to use in bucket name generation.
|
gridName| Constructor and Description |
|---|
S3CheckpointSpi() |
| Modifier and Type | Method and Description |
|---|---|
String |
getAccessKey()
Gets S3 access key.
|
String |
getBucketName()
Gets S3 bucket name to use.
|
String |
getProxyHost()
Gets HTTP proxy host.
|
String |
getProxyPassword()
Gets HTTP proxy password.
|
int |
getProxyPort()
Gets HTTP proxy port.
|
String |
getProxyUsername()
Gets HTTP proxy user name.
|
String |
getSecretAccessKey()
Gets S3 secret key.
|
byte[] |
loadCheckpoint(String key) |
boolean |
removeCheckpoint(String key) |
boolean |
saveCheckpoint(String key,
byte[] state,
long timeout,
boolean overwrite) |
void |
setAwsCredentials(com.amazonaws.auth.AWSCredentials cred)
Sets AWS credentials.
|
void |
setBucketNameSuffix(String bucketNameSuffix)
Sets bucket name suffix.
|
void |
setCheckpointListener(CheckpointListener lsnr) |
void |
setClientConfiguration(com.amazonaws.ClientConfiguration cfg)
Sets Amazon client configuration.
|
void |
spiStart(String gridName) |
void |
spiStop() |
String |
toString() |
addTimeoutObject, assertParameter, checkConfigurationConsistency0, configInfo, createSpiAttributeName, failureDetectionTimeout, failureDetectionTimeoutEnabled, failureDetectionTimeoutEnabled, getConsistentAttributeNames, getExceptionRegistry, getIgniteHome, getLocalNode, getLocalNodeId, getName, getNodeAttributes, getSpiContext, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, initFailureDetectionTimeout, injectables, injectResources, isNodeStopping, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextDestroyed0, onContextInitialized, onContextInitialized0, registerMBean, removeTimeoutObject, setName, startInfo, startStopwatch, stopInfo, unregisterMBeanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getNodeAttributes, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextInitializedgetIgniteHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormattedpublic static final String BUCKET_NAME_PREFIX
public static final String DFLT_BUCKET_NAME_SUFFIX
public String getBucketName()
getBucketName in interface S3CheckpointSpiMBeanpublic String getAccessKey()
getAccessKey in interface S3CheckpointSpiMBeanpublic String getSecretAccessKey()
public String getProxyHost()
getProxyHost in interface S3CheckpointSpiMBeanpublic int getProxyPort()
getProxyPort in interface S3CheckpointSpiMBeanpublic String getProxyUsername()
getProxyUsername in interface S3CheckpointSpiMBeanpublic String getProxyPassword()
@IgniteSpiConfiguration(optional=true) public void setBucketNameSuffix(String bucketNameSuffix)
bucketNameSuffix - Bucket name suffix.@IgniteSpiConfiguration(optional=true) public void setClientConfiguration(com.amazonaws.ClientConfiguration cfg)
For details refer to Amazon S3 API reference.
cfg - Amazon client configuration.@IgniteSpiConfiguration(optional=false) public void setAwsCredentials(com.amazonaws.auth.AWSCredentials cred)
For details refer to Amazon S3 API reference.
cred - AWS credentials.public void spiStart(String gridName) throws IgniteSpiException
spiStart in interface IgniteSpiIgniteSpiExceptionpublic void spiStop()
throws IgniteSpiException
spiStop in interface IgniteSpiIgniteSpiExceptionpublic byte[] loadCheckpoint(String key) throws IgniteSpiException
loadCheckpoint in interface CheckpointSpiIgniteSpiExceptionpublic boolean saveCheckpoint(String key, byte[] state, long timeout, boolean overwrite) throws IgniteSpiException
saveCheckpoint in interface CheckpointSpiIgniteSpiExceptionpublic boolean removeCheckpoint(String key)
removeCheckpoint in interface CheckpointSpipublic void setCheckpointListener(CheckpointListener lsnr)
setCheckpointListener in interface CheckpointSpi
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.0.final Release Date : December 29 2015