new operation SOFT_COPY managed
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/storage-manager-trigger@169351 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d6a9a82c91
commit
5e90923655
|
@ -133,6 +133,8 @@ import org.slf4j.LoggerFactory;
|
|||
return StorageUsageRecord.OperationType.UPDATE;
|
||||
case "COPY":
|
||||
return StorageUsageRecord.OperationType.CREATE;
|
||||
case "SOFT_COPY":
|
||||
return StorageUsageRecord.OperationType.CREATE;
|
||||
case "MOVE_DIR":
|
||||
return StorageUsageRecord.OperationType.UPDATE;
|
||||
case "COPY_DIR":
|
||||
|
|
|
@ -118,7 +118,7 @@ public class FolderAccountingConsumer extends Thread{
|
|||
if(isNeedFSReport(lastOperation)){
|
||||
try{
|
||||
mongo=new MongoDB(server, user, password);
|
||||
if(lastOperation.equalsIgnoreCase("COPY"))
|
||||
if(lastOperation.equalsIgnoreCase("COPY") || lastOperation.equalsIgnoreCase("SOFT_COPY"))
|
||||
owner=lastUser;
|
||||
//extract folder from filename field
|
||||
String folder=filename.substring(0, filename.lastIndexOf("/"));
|
||||
|
@ -160,7 +160,7 @@ public class FolderAccountingConsumer extends Thread{
|
|||
|
||||
|
||||
private boolean isNeedSSReport(String lastOperation) {
|
||||
if(lastOperation.equalsIgnoreCase("UPLOAD") || lastOperation.equalsIgnoreCase("COPY") || lastOperation.equalsIgnoreCase("DELETE"))
|
||||
if(lastOperation.equalsIgnoreCase("UPLOAD") || lastOperation.equalsIgnoreCase("COPY") || lastOperation.equalsIgnoreCase("SOFT_COPY") || lastOperation.equalsIgnoreCase("DELETE"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ public class FolderAccountingConsumer extends Thread{
|
|||
* @return
|
||||
*/
|
||||
private boolean isNeedFSReport(String lastOperation) {
|
||||
if(lastOperation.equalsIgnoreCase("UPLOAD") || lastOperation.equalsIgnoreCase("COPY") || lastOperation.equalsIgnoreCase("DELETE") || lastOperation.equalsIgnoreCase("MOVE"))
|
||||
if(lastOperation.equalsIgnoreCase("UPLOAD") || lastOperation.equalsIgnoreCase("COPY") || lastOperation.equalsIgnoreCase("SOFT_COPY") || lastOperation.equalsIgnoreCase("DELETE") || lastOperation.equalsIgnoreCase("MOVE"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ public class UserAccountingConsumer extends Thread{
|
|||
logger.debug("[recordCheck] update SS record yet");
|
||||
if (mongo== null)
|
||||
mongo=new MongoDB(server, user, password);
|
||||
if(record.getLastOperation().equalsIgnoreCase("COPY"))
|
||||
if(record.getLastOperation().equalsIgnoreCase("COPY") || record.getLastOperation().equalsIgnoreCase("SOFT_COPY"))
|
||||
record.setOwner(record.getLastUser());
|
||||
ssr=new StorageStatusObject(record.getOwner(), record.getLength(), 1);
|
||||
ssr=mongo.updateUserVolume(ssr, record.getLastOperation());
|
||||
|
@ -183,7 +183,7 @@ public class UserAccountingConsumer extends Thread{
|
|||
*/
|
||||
private boolean isNeedSSReport(String lastOperation) {
|
||||
logger.trace("Last operation is "+lastOperation);
|
||||
if(lastOperation.equalsIgnoreCase("UPLOAD") || lastOperation.equalsIgnoreCase("COPY") || lastOperation.equalsIgnoreCase("DELETE"))
|
||||
if(lastOperation.equalsIgnoreCase("UPLOAD") || lastOperation.equalsIgnoreCase("COPY") || lastOperation.equalsIgnoreCase("SOFT_COPY")|| lastOperation.equalsIgnoreCase("DELETE"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ public class FolderStatusOperationManager {
|
|||
|
||||
private long volumeCalculation(long currentVolume, long partialVolume, String operation) {
|
||||
logger.debug("folder accounting: operation "+operation+" total Volume "+partialVolume+" current volume "+currentVolume);
|
||||
if(operation.equalsIgnoreCase("UPLOAD") || operation.equalsIgnoreCase("COPY")){
|
||||
if(operation.equalsIgnoreCase("UPLOAD") || operation.equalsIgnoreCase("COPY") || operation.equalsIgnoreCase("SOFT_COPY")){
|
||||
partialVolume=partialVolume+currentVolume;
|
||||
}else if(operation.equalsIgnoreCase("DELETE")){
|
||||
partialVolume=partialVolume-currentVolume;
|
||||
|
@ -120,7 +120,7 @@ public class FolderStatusOperationManager {
|
|||
|
||||
private int countCalculation(int currentCount, int partialCount, String operation) {
|
||||
logger.debug("folder accounting operation "+operation+" partial count "+partialCount+" current count"+currentCount);
|
||||
if(operation.equalsIgnoreCase("UPLOAD")|| operation.equalsIgnoreCase("COPY"))
|
||||
if(operation.equalsIgnoreCase("UPLOAD")|| operation.equalsIgnoreCase("COPY") || operation.equalsIgnoreCase("SOFT_COPY"))
|
||||
partialCount=partialCount+currentCount;
|
||||
else if(operation.equalsIgnoreCase("DELETE"))
|
||||
partialCount=partialCount-currentCount;
|
||||
|
|
|
@ -95,7 +95,7 @@ public class StorageStatusOperationManager {
|
|||
|
||||
private long volumeCalculation(long currentVolume, long partialVolume, String operation) {
|
||||
logger.info("accounting: operation "+operation+" total Volume "+partialVolume+" current volume "+currentVolume);
|
||||
if(operation.equalsIgnoreCase("UPLOAD") || operation.equalsIgnoreCase("COPY")){
|
||||
if(operation.equalsIgnoreCase("UPLOAD") || operation.equalsIgnoreCase("COPY") || operation.equalsIgnoreCase("SOFT_COPY")){
|
||||
partialVolume=partialVolume+currentVolume;
|
||||
}else if(operation.equalsIgnoreCase("DELETE")){
|
||||
partialVolume=partialVolume-currentVolume;
|
||||
|
@ -108,7 +108,7 @@ public class StorageStatusOperationManager {
|
|||
// int partial=Integer.parseInt(partialCount);
|
||||
// int current=Integer.parseInt(currentCount);
|
||||
logger.info("accounting: operation "+operation+" old count "+partial+" current count"+current);
|
||||
if(operation.equalsIgnoreCase("UPLOAD")|| operation.equalsIgnoreCase("COPY"))
|
||||
if(operation.equalsIgnoreCase("UPLOAD")|| operation.equalsIgnoreCase("COPY") || operation.equalsIgnoreCase("SOFT_COPY"))
|
||||
partial=partial+current;
|
||||
else if(operation.equalsIgnoreCase("DELETE"))
|
||||
partial=partial-current;
|
||||
|
|
Loading…
Reference in New Issue