disabled folder consumer

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/storage-manager-trigger@101366 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
roberto.cirillo 2014-11-03 13:36:19 +00:00
parent 6e224d7771
commit 01b8cac5c2
2 changed files with 31 additions and 22 deletions

View File

@ -78,8 +78,9 @@ public class ReadingMongoOplog extends Thread{
if(x.containsField("o")){
// c1 buffer for suer accounting
c1.put(x);
// c2 buffer for folder accounting (TODO)
c2.put(x);
// c2 buffer for folder accounting (TODO)
if(c2 !=null)
c2.put(x);
// parser.runWithoutThread(x);
logger.debug("Producer #" + this.number + " put: " + x);
}else{
@ -88,12 +89,6 @@ public class ReadingMongoOplog extends Thread{
}else{
logger.debug("record discarded: \t"+x);
}
try {
Thread.sleep(20000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
try {
Thread.sleep(1000);

View File

@ -33,7 +33,6 @@ public class Startup {
return;
}
scope=args[0];
String oplogServer= args[1];
if(args.length == 4){
@ -44,26 +43,41 @@ public class Startup {
String[] server=retrieveServerConfiguration(cfg);
List<String> dtsHosts=retrieveDTSConfiguration(cfg);
CubbyHole c1 = new CubbyHole();
CubbyHole c2 = new CubbyHole();
ReadingMongoOplog producer=null;
CubbyHole c2 = null;//new CubbyHole();
startProducer(args, oplogServer, server, c1, c2);
startUserAccountingConsumer(args, server, dtsHosts, c1);
// startFolderAccountingConsumer(args, server, c2);
}
private static void startFolderAccountingConsumer(String[] args,
String[] server, CubbyHole c2) {
FolderAccountingConsumer fsConsumer=null;
if(args.length == 3)
producer=new ReadingMongoOplog( Arrays.asList(oplogServer), args[1], args[2], c1, c2, 1 );
fsConsumer=new FolderAccountingConsumer(server, c2, 1);
else
producer=new ReadingMongoOplog( Arrays.asList(server), c1, c2, 1 );
UserAccountingConsumer ssConsumer=null;
fsConsumer=new FolderAccountingConsumer(server, args[1], args[2], c2, 1);
fsConsumer.start();
}
private static void startUserAccountingConsumer(String[] args,
String[] server, List<String> dtsHosts, CubbyHole c1) {
UserAccountingConsumer ssConsumer=null;
if(args.length == 3)
ssConsumer=new UserAccountingConsumer(server, c1, 1, dtsHosts);
else
ssConsumer=new UserAccountingConsumer(server, args[1], args[2], c1, 1, dtsHosts);
// FolderAccountingConsumer fsConsumer=null;
// if(args.length == 3)
// fsConsumer=new FolderAccountingConsumer(server, c2, 1);
// else
// fsConsumer=new FolderAccountingConsumer(server, args[1], args[2], c2, 1);
producer.start();
ssConsumer.start();
// fsConsumer.start();
}
}
private static void startProducer(String[] args, String oplogServer,
String[] server, CubbyHole c1, CubbyHole c2) {
ReadingMongoOplog producer=null;
if(args.length == 3)
producer=new ReadingMongoOplog( Arrays.asList(oplogServer), args[1], args[2], c1, c2, 1 );
else
producer=new ReadingMongoOplog( Arrays.asList(server), c1, c2, 1 );
producer.start();
}
private static String[] retrieveServerConfiguration(Configuration c) {
return c.getServerAccess();