removed old dts filter
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/storage-manager-trigger@134085 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1a700634da
commit
d6ef341506
2
pom.xml
2
pom.xml
|
@ -8,7 +8,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>org.gcube.contentmanagement</groupId>
|
<groupId>org.gcube.contentmanagement</groupId>
|
||||||
<artifactId>storage-manager-trigger</artifactId>
|
<artifactId>storage-manager-trigger</artifactId>
|
||||||
<version>1.5.0-SNAPSHOT</version>
|
<version>1.6.0-SNAPSHOT</version>
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId}</connection>
|
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId}</connection>
|
||||||
<developerConnection>scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId}</developerConnection>
|
<developerConnection>scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId}</developerConnection>
|
||||||
|
|
|
@ -69,19 +69,21 @@ public class UserAccountingConsumer extends Thread{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
|
logger.info("Sniffing is started ");
|
||||||
while(true){
|
while(true){
|
||||||
DBObject x=null;
|
DBObject x=null;
|
||||||
MongoDB mongo=null;
|
MongoDB mongo=null;
|
||||||
try{
|
try{
|
||||||
|
logger.info("Waiting next record... ");
|
||||||
x=c.get();
|
x=c.get();
|
||||||
logger.debug("Consumer #" + this.number + " got: " + x);
|
logger.info("Consumer #" + this.number + " got: " + x);
|
||||||
op = (String) x.get("op");
|
op = (String) x.get("op");
|
||||||
// retrieve object fields
|
// retrieve object fields
|
||||||
DBObject obj=(DBObject)x.get("o");
|
DBObject obj=(DBObject)x.get("o");
|
||||||
OpLogRemoteObject record=retrieveObjectFields(obj);
|
OpLogRemoteObject record=retrieveObjectFields(obj);
|
||||||
// set object dimension
|
// set object dimension
|
||||||
|
|
||||||
logger.debug("[recordCheck] operation: "+op+" name: "+record.getName()+" type: "+record.getType()+" path: "+record.getFilename()+" dir Path: "+record.getDir()+" length: "+record.getLength()+" owner: "+record.getOwner()+ " lastOperation "+record.getLastOperation()+" lastUser: "+record.getLastUser()+" lastAccess: "+record.getLastAccess());
|
logger.info("[recordCheck] operation: "+op+" name: "+record.getName()+" type: "+record.getType()+" path: "+record.getFilename()+" dir Path: "+record.getDir()+" length: "+record.getLength()+" owner: "+record.getOwner()+ " lastOperation "+record.getLastOperation()+" lastUser: "+record.getLastUser()+" lastAccess: "+record.getLastAccess());
|
||||||
if(((record.getLength() >0) && (((record.getFilename() !=null) && (record.getFilename().length()>0) && (record.getDir().length()>0)&& (record.getDir().contains("/"))) || (record.getLinkCount() > 0)))){
|
if(((record.getLength() >0) && (((record.getFilename() !=null) && (record.getFilename().length()>0) && (record.getDir().length()>0)&& (record.getDir().contains("/"))) || (record.getLinkCount() > 0)))){
|
||||||
//convert from byte to kb
|
//convert from byte to kb
|
||||||
record.setLength(record.getLength()/1024);
|
record.setLength(record.getLength()/1024);
|
||||||
|
@ -155,8 +157,8 @@ public class UserAccountingConsumer extends Thread{
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
e.printStackTrace();
|
logger.error(" "+e.getCause().getLocalizedMessage());
|
||||||
logger.error("ERROR Processing record: "+x+" Exception throws: "+e.getStackTrace());
|
logger.error("ERROR Processing record: "+x+" Exception throws: "+e.getMessage());
|
||||||
logger.info("skip to next record ");
|
logger.info("skip to next record ");
|
||||||
if(mongo!=null)
|
if(mongo!=null)
|
||||||
mongo.close();
|
mongo.close();
|
||||||
|
|
|
@ -14,13 +14,13 @@ public class ValidationUtils {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ValidationUtils.class);
|
private static final Logger logger = LoggerFactory.getLogger(ValidationUtils.class);
|
||||||
|
|
||||||
public static boolean validationScope(String scope){
|
public static boolean validationScope(String scope){
|
||||||
logger.debug("scope Validation for scope "+scope);
|
logger.info("scope Validation for scope "+scope);
|
||||||
ScopeBean scopeBean=new ScopeBean(scope);
|
ScopeBean scopeBean=new ScopeBean(scope);
|
||||||
if((scopeBean.is(Type.VRE)))
|
if((scopeBean.is(Type.VRE)))
|
||||||
scope=scopeBean.enclosingScope().toString();
|
scope=scopeBean.enclosingScope().toString();
|
||||||
Set<String> scopeSet=new ServiceMapScannerMediator().getScopeKeySet();
|
Set<String> scopeSet=new ServiceMapScannerMediator().getScopeKeySet();
|
||||||
for(String scopeItem : scopeSet){
|
for(String scopeItem : scopeSet){
|
||||||
logger.debug("scope scanned: "+scopeItem);
|
logger.info("scope scanned: "+scopeItem);
|
||||||
if(scope.equals(scopeItem))
|
if(scope.equals(scopeItem))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,11 +35,7 @@ public class Startup {
|
||||||
}
|
}
|
||||||
scope=args[0];
|
scope=args[0];
|
||||||
String oplogServer= args[1];
|
String oplogServer= args[1];
|
||||||
// if(args.length == 4){
|
Configuration cfg=new Configuration(scope, false);
|
||||||
// user=args[2];
|
|
||||||
// password=args[3];
|
|
||||||
// }
|
|
||||||
Configuration cfg=new Configuration(scope, true);
|
|
||||||
String[] server=retrieveServerConfiguration(cfg);
|
String[] server=retrieveServerConfiguration(cfg);
|
||||||
|
|
||||||
List<String> dtsHosts=retrieveDTSConfiguration(cfg);
|
List<String> dtsHosts=retrieveDTSConfiguration(cfg);
|
||||||
|
|
|
@ -80,6 +80,7 @@ public class MongoDB {
|
||||||
|
|
||||||
|
|
||||||
public StorageStatusObject updateUserVolume(StorageStatusObject ssRecord, String operation){
|
public StorageStatusObject updateUserVolume(StorageStatusObject ssRecord, String operation){
|
||||||
|
logger.debug("updating user volume");
|
||||||
ssRecord= ssOperationManager.updateUser(ssRecord, operation);
|
ssRecord= ssOperationManager.updateUser(ssRecord, operation);
|
||||||
close();
|
close();
|
||||||
return ssRecord;
|
return ssRecord;
|
||||||
|
|
Loading…
Reference in New Issue