|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.project.ProjectReplicationTool
public class ProjectReplicationTool
Replicates chunks for one or more projects to select servers.
| Constructor Summary | |
|---|---|
ProjectReplicationTool(java.security.cert.X509Certificate cert,
java.security.PrivateKey key)
|
|
ProjectReplicationTool(java.security.cert.X509Certificate cert,
java.security.PrivateKey key,
java.util.Collection<java.lang.String> serversToRead,
java.util.Collection<java.lang.String> serversToWrite)
|
|
| Method Summary | |
|---|---|
boolean |
addProjectReplicationToolListener(ProjectReplicationToolListener l)
Add a listener to the tool. |
void |
clearProjectReplicationToolListeners()
Clear out listeners used by the tool. |
void |
execute()
Start replication. |
void |
fireDataChunkFailed(BigHash h)
Event fired when data chunk failed. |
void |
fireDataChunkReplicated(BigHash h)
Event fired when data chunk replicated. |
void |
fireDataChunkSkipped(BigHash h)
Event fired when data chunk skipped. |
void |
fireFileFailed(BigHash h)
Event fired when file failed. |
void |
fireFileFinished(BigHash h)
Event fired when file finished. |
void |
fireMetaDataChunkFailed(BigHash h)
Event fired when meta data chunk failed. |
void |
fireMetaDataChunkReplicated(BigHash h)
Event fired when meta data chunk replicated. |
void |
fireMetaDataChunkSkipped(BigHash h)
Event fired when meta data chunk skipped. |
void |
fireReplicationFailed()
Event fired when replication failed. |
void |
fireReplicationFinished()
Event fired when replication finished. |
void |
fireReplicationStarted(ProjectReplicationTool tool)
Event fired when replication started. |
java.security.cert.X509Certificate |
getCert()
Get the certificate used by the tool. |
long |
getFailedDataChunkCount()
Get the failed data chunk count. |
long |
getFailedMetaDataChunkCount()
Get the failed meta data chunk count. |
BigHash |
getHash()
Get the project hash used by the tool. |
java.security.PrivateKey |
getKey()
Get the private key used by the tool. |
int |
getNumberRequiredReplications()
Get the required replication count. |
java.lang.String |
getPassphrase()
Get passphrase used by the tool. |
java.util.Collection<java.lang.String> |
getServersToRead()
Get the servers from which to read. |
java.util.Collection<java.lang.String> |
getServersToWrite()
Get the servers to which to write. |
long |
getSizeAlreadyHandled()
Get the size of data already replicated. |
long |
getSizeOfProject()
Get the size of the project being replicated. |
long |
getSkippedDataChunkCount()
Get the skipped data chunk count. |
long |
getSkippedMetaDataChunkCount()
Get the skipped meta data chunk count. |
long |
getSuccessDataChunkCount()
Get the count of successful data chunk replications. |
long |
getSuccessMetaDataChunkCount()
Get the count of successful meta data chunk replications. |
protected void |
replicateProject(MetaData projectMetaData)
Helper method to replicate the project. |
protected void |
replicateSingleFile(BigHash fileHash,
MetaData fileMetaData)
Used to replicate a single-file upload OR a file within a project. |
void |
setCert(java.security.cert.X509Certificate cert)
Set the certificate used by the tool. |
void |
setHash(BigHash hash)
Set the project hash used by the tool. |
void |
setKey(java.security.PrivateKey key)
Set the private key used by the tool. |
void |
setNumberRequiredReplications(int numberRequiredReplications)
Set the required replication count. |
void |
setPassphrase(java.lang.String passphrase)
Set passphrase used by the tool. |
void |
setServersToRead(java.util.List<java.lang.String> serversToRead)
Set the servers from which to read. |
void |
setServersToWrite(java.util.List<java.lang.String> serversToWrite)
Set the servers to which to write. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProjectReplicationTool(java.security.cert.X509Certificate cert,
java.security.PrivateKey key)
cert - key -
public ProjectReplicationTool(java.security.cert.X509Certificate cert,
java.security.PrivateKey key,
java.util.Collection<java.lang.String> serversToRead,
java.util.Collection<java.lang.String> serversToWrite)
cert - key - serversToRead - serversToWrite - | Method Detail |
|---|
public void execute()
throws java.lang.Exception
Start replication.
java.lang.Exception
protected void replicateSingleFile(BigHash fileHash,
MetaData fileMetaData)
throws java.lang.Exception
Used to replicate a single-file upload OR a file within a project. When replicating project, this will be called many times.
fileHash - fileMetaData -
java.lang.Exception
protected void replicateProject(MetaData projectMetaData)
throws java.lang.Exception
Helper method to replicate the project.
projectMetaData -
java.lang.Exceptionpublic java.security.cert.X509Certificate getCert()
Get the certificate used by the tool.
public void setCert(java.security.cert.X509Certificate cert)
Set the certificate used by the tool.
cert - public java.security.PrivateKey getKey()
Get the private key used by the tool.
public void setKey(java.security.PrivateKey key)
Set the private key used by the tool.
key - public BigHash getHash()
Get the project hash used by the tool.
public void setHash(BigHash hash)
Set the project hash used by the tool.
hash - public java.lang.String getPassphrase()
Get passphrase used by the tool.
public void setPassphrase(java.lang.String passphrase)
Set passphrase used by the tool.
passphrase - public boolean addProjectReplicationToolListener(ProjectReplicationToolListener l)
Add a listener to the tool.
l -
public void clearProjectReplicationToolListeners()
Clear out listeners used by the tool.
public void fireReplicationStarted(ProjectReplicationTool tool)
Event fired when replication started.
fireReplicationStarted in interface ProjectReplicationToolListenertool - public void fireReplicationFailed()
Event fired when replication failed.
fireReplicationFailed in interface ProjectReplicationToolListenerpublic void fireReplicationFinished()
Event fired when replication finished.
fireReplicationFinished in interface ProjectReplicationToolListenerpublic void fireDataChunkReplicated(BigHash h)
Event fired when data chunk replicated.
fireDataChunkReplicated in interface ProjectReplicationToolListenerh - public void fireMetaDataChunkReplicated(BigHash h)
Event fired when meta data chunk replicated.
fireMetaDataChunkReplicated in interface ProjectReplicationToolListenerh - public void fireDataChunkSkipped(BigHash h)
Event fired when data chunk skipped.
fireDataChunkSkipped in interface ProjectReplicationToolListenerh - public void fireMetaDataChunkSkipped(BigHash h)
Event fired when meta data chunk skipped.
fireMetaDataChunkSkipped in interface ProjectReplicationToolListenerh - public void fireDataChunkFailed(BigHash h)
Event fired when data chunk failed.
fireDataChunkFailed in interface ProjectReplicationToolListenerh - public void fireMetaDataChunkFailed(BigHash h)
Event fired when meta data chunk failed.
fireMetaDataChunkFailed in interface ProjectReplicationToolListenerh - public void fireFileFailed(BigHash h)
Event fired when file failed.
fireFileFailed in interface ProjectReplicationToolListenerh - public void fireFileFinished(BigHash h)
Event fired when file finished.
fireFileFinished in interface ProjectReplicationToolListenerh - public long getSizeOfProject()
Get the size of the project being replicated.
public long getSizeAlreadyHandled()
Get the size of data already replicated.
public long getFailedDataChunkCount()
Get the failed data chunk count.
public long getFailedMetaDataChunkCount()
Get the failed meta data chunk count.
public long getSkippedDataChunkCount()
Get the skipped data chunk count.
public long getSkippedMetaDataChunkCount()
Get the skipped meta data chunk count.
public long getSuccessDataChunkCount()
Get the count of successful data chunk replications.
public long getSuccessMetaDataChunkCount()
Get the count of successful meta data chunk replications.
public int getNumberRequiredReplications()
Get the required replication count.
public void setNumberRequiredReplications(int numberRequiredReplications)
Set the required replication count.
numberRequiredReplications - public java.util.Collection<java.lang.String> getServersToRead()
Get the servers from which to read.
public void setServersToRead(java.util.List<java.lang.String> serversToRead)
Set the servers from which to read.
serversToRead - public java.util.Collection<java.lang.String> getServersToWrite()
Get the servers to which to write.
public void setServersToWrite(java.util.List<java.lang.String> serversToWrite)
Set the servers to which to write.
serversToWrite -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||