Mercurial > hg > Members > tatsuki > Alice
changeset 337:5fa184113850 META_CODESEGMENT
before adding Branch META_CODESEGMENT
author | sugi |
---|---|
date | Wed, 16 Apr 2014 16:09:27 +0900 |
parents | 2f003d5703d5 |
children | a725e90c3a9b |
files | src/alice/codesegment/CodeSegment.java src/alice/codesegment/CodeSegmentManager.java src/alice/topology/manager/StartTopologyManager.java |
diffstat | 3 files changed, 9 insertions(+), 52 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/codesegment/CodeSegment.java Mon Apr 14 15:46:29 2014 +0900 +++ b/src/alice/codesegment/CodeSegment.java Wed Apr 16 16:09:27 2014 +0900 @@ -10,13 +10,6 @@ public InputDataSegment ids = new InputDataSegment(this); public OutputDataSegment ods = new OutputDataSegment(); public ArrayList<Receiver> list = new ArrayList<Receiver>(); - public CodeSegment codeSegment; - private Class<CodeSegment> meta; - private boolean flag = false; - - public void setKey(){ - // for meta CodeSegment - } public void execute() { ids.receive(); @@ -30,27 +23,4 @@ } } - @SuppressWarnings("unchecked") - public <T> void setMeta(Class<T> cs){ - flag = true; - meta = (Class<CodeSegment>) cs; - } - - public boolean hasMeta(){ - return flag; - } - - public void setCodeSegment(CodeSegment cs){ - codeSegment = cs; - } - - public CodeSegment getCodeSegment(){ - return codeSegment; - } - - public Class<CodeSegment> getMetaClass(){ - flag = false; - return meta; - } - }
--- a/src/alice/codesegment/CodeSegmentManager.java Mon Apr 14 15:46:29 2014 +0900 +++ b/src/alice/codesegment/CodeSegmentManager.java Wed Apr 16 16:09:27 2014 +0900 @@ -10,10 +10,10 @@ private static CodeSegmentManager instance = new CodeSegmentManager(); private ThreadPoolExecutor codeSegmentExecutor = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), // initial number of threads - Runtime.getRuntime().availableProcessors(), - Integer.MAX_VALUE, // keepAliveTime - TimeUnit.SECONDS, - new LinkedBlockingQueue<Runnable>()); + Runtime.getRuntime().availableProcessors(), + Integer.MAX_VALUE, // keepAliveTime + TimeUnit.SECONDS, + new LinkedBlockingQueue<Runnable>()); private Logger logger = Logger.getLogger(CodeSegmentManager.class); public static CodeSegmentManager get() { @@ -21,23 +21,11 @@ } public static void submit(CodeSegment cs) { - if (cs.hasMeta()){ - try { - CodeSegment meta = cs.getMetaClass().newInstance(); - meta.setCodeSegment(cs); - meta.setKey(); - - } catch (Exception e) { - e.printStackTrace(); - } - - } else { - CodeSegmentManager csManager = CodeSegmentManager.get(); - csManager.codeSegmentExecutor.execute(cs); - if (csManager.logger.isDebugEnabled()) { - csManager.logger.debug(cs.getClass().getName()); - } + CodeSegmentManager csManager = CodeSegmentManager.get(); + csManager.codeSegmentExecutor.execute(cs); + if (csManager.logger.isDebugEnabled()) { + csManager.logger.debug(cs.getClass().getName()); } } - + }
--- a/src/alice/topology/manager/StartTopologyManager.java Mon Apr 14 15:46:29 2014 +0900 +++ b/src/alice/topology/manager/StartTopologyManager.java Wed Apr 16 16:09:27 2014 +0900 @@ -74,7 +74,6 @@ logger.error("File format error: " + conf.confFilePath); e.printStackTrace(); } - HashMap<String, ArrayList<HostMessage>> connectionList = new HashMap<String, ArrayList<HostMessage>>(); ods.put("connection", connectionList); ods.put("_ABSIPTABLE" ,new ArrayList<HostMessage>());