Mercurial > hg > Database > Alice
changeset 467:6e304a7a60e7 dispose
remove white space
line wrap: on
line diff
--- a/src/main/java/alice/codesegment/OutputDataSegment.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/codesegment/OutputDataSegment.java Sat Nov 22 12:08:24 2014 +0900 @@ -33,7 +33,7 @@ public void put(String key, ReceiveData rData) { DataSegment.getLocal().put(key, rData, null); } - + public void put(String key, Object val) { ReceiveData rData = new ReceiveData(val, false, false); DataSegment.getLocal().put(key, rData, null); @@ -55,7 +55,7 @@ put(key, rData); } } - + public void put(String managerKey, String key, Object val) { if (!managerKey.equals("local")){ ReceiveData rData = new ReceiveData(val, false, false); @@ -65,7 +65,7 @@ put(key, val); } } - + public void quickPut(String managerKey, String key, ReceiveData rData) { if (!managerKey.equals("local")){ SendOption option = new SendOption(true, compressFlag()); @@ -84,7 +84,7 @@ put(key, val); } } - + public void update(String managerKey, String key, ReceiveData rData) { if (!managerKey.equals("local")){ SendOption option = new SendOption(false, compressFlag()); @@ -103,7 +103,7 @@ update(key, val); } } - + public void quickUpdate(String managerKey, String key, ReceiveData rData) { if (!managerKey.equals("local")){ SendOption option = new SendOption(true, compressFlag()); @@ -125,7 +125,7 @@ /** * kill the Alice process after send other messages. - * + * * @param managerKey */ @@ -135,7 +135,7 @@ /** * close socket for RemoteDataSegment after send other messages. - * + * * @param managerKey */ @@ -145,8 +145,8 @@ /** * "key" is not remote DataSegment's key. - * "Ping Response" return in this "key" - * + * "Ping Response" return in this "key" + * * @param managerKey * @param key */ @@ -156,7 +156,7 @@ /** * this method is to forcibly close socket - * + * * @param managerKey */
--- a/src/main/java/alice/daemon/CommandMessage.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/daemon/CommandMessage.java Sat Nov 22 12:08:24 2014 +0900 @@ -11,7 +11,7 @@ public boolean quickFlag = false; public boolean serialized = false; public boolean compressed = false; - + public CommandMessage() {} public CommandMessage(int type, int index, int seq, String key
--- a/src/main/java/alice/daemon/Connection.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/daemon/Connection.java Sat Nov 22 12:08:24 2014 +0900 @@ -34,7 +34,7 @@ + ":" + socket.getPort(); } - public synchronized void write(Command cmd) { + public synchronized void write(Command cmd) { ByteBuffer buffer = cmd.convert(); try { while (buffer.hasRemaining()) {
--- a/src/main/java/alice/daemon/IncomingTcpConnection.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/daemon/IncomingTcpConnection.java Sat Nov 22 12:08:24 2014 +0900 @@ -68,7 +68,7 @@ cmd = new Command(type, null, null, null, msg.index, msg.seq, null, null, connection); cmd.setQuickFlag(msg.quickFlag); lmanager.getDataSegmentKey(msg.key).runCommand(cmd); - break; + break; case REMOVE: cmd = new Command(type, null, null, null, 0, 0, null, null, ""); lmanager.getDataSegmentKey(msg.key).runCommand(cmd); @@ -76,7 +76,7 @@ case REPLY: cmd = manager.getAndRemoveCmd(msg.seq); rData = new ReceiveData(getSerializedByteArray(unpacker), msg.compressed, msg.serialized); - Command rCmd = new Command(type, null, null, rData, msg.index, msg.seq, null, null, ""); + Command rCmd = new Command(type, null, null, rData, msg.index, msg.seq, null, null, ""); cmd.cs.ids.reply(cmd.receiver, rCmd); break; case PING: @@ -100,7 +100,7 @@ e.printStackTrace(); } } - + } private byte[] getSerializedByteArray(Unpacker unpacker) {
--- a/src/main/java/alice/daemon/IncomingUdpConnection.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/daemon/IncomingUdpConnection.java Sat Nov 22 12:08:24 2014 +0900 @@ -38,7 +38,7 @@ byte[] val = null; ReceiveData rData = null; // Max data length is 65507 because of the max length of UDP payload - ByteBuffer receive = ByteBuffer.allocate(65507); + ByteBuffer receive = ByteBuffer.allocate(65507); receiver.receive(receive); Unpacker unpacker = SingletonMessage.getInstance().createBufferUnpacker(receive); receive.flip(); @@ -47,7 +47,7 @@ switch (type) { case UPDATE: case PUT: - val = new byte[unpacker.readInt()]; + val = new byte[unpacker.readInt()]; receive.get(val); rData = new ReceiveData(val, msg.compressed, msg.serialized); cmd = new Command(type, null, null, rData, 0, 0, null, null, reverseKey);
--- a/src/main/java/alice/datasegment/Command.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/datasegment/Command.java Sat Nov 22 12:08:24 2014 +0900 @@ -59,7 +59,7 @@ } return this.type + "\t" + key + "\t" + rData + "\tindex=" + index + "\tcs=" + csName; } - + /** * @return serialized ByteBuffer */ @@ -102,7 +102,7 @@ compressed = true; } } - + header = msg.write(new CommandMessage(type.id, index, seq, key, false, serialized, compressed)); dataSize = msg.write(data.length); buf = ByteBuffer.allocate(header.length+dataSize.length+data.length); @@ -123,43 +123,43 @@ } return buf; } - + /** * If this flag is true, command isn't send queue. * command is executed right now. - * + * * @param flag */ - + public void setQuickFlag(boolean flag){ quickFlag = flag; } - + public boolean getQuickFlag(){ return quickFlag; } - + /** * Before sending Remote DataSegment, DataSegment type is ByteArray. * If this flag true, ByteArray is compressed with ZRLEE(ZRIB) algorithm - * + * * @param flag */ - + public void setCompressFlag(boolean flag){ compressFlag = flag; } - + public boolean getCompressFlag(){ return compressFlag; } - + public byte[] zip(byte[] input) throws IOException{ Deflater deflater = new Deflater(); ByteArrayOutputStream os = new ByteArrayOutputStream(); DeflaterOutputStream dos = new DeflaterOutputStream(os, deflater); dos.write(input); - dos.finish(); + dos.finish(); return os.toByteArray(); - } + } }
--- a/src/main/java/alice/datasegment/CommandType.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/datasegment/CommandType.java Sat Nov 22 12:08:24 2014 +0900 @@ -10,7 +10,7 @@ REMOVE, REPLY, CLOSE, - FINISH, + FINISH, PING, RESPONSE;
--- a/src/main/java/alice/datasegment/DataSegmentKey.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/datasegment/DataSegmentKey.java Sat Nov 22 12:08:24 2014 +0900 @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.Iterator; -import alice.datasegment.Command; +import alice.datasegment.Command; /** * Synchronized DataSegment for each DataSegment key @@ -25,7 +25,7 @@ case PUT: int index = tailIndex; tailIndex++; - DataSegmentValue dsv = new DataSegmentValue(index, cmd.rData, cmd.reverseKey); + DataSegmentValue dsv = new DataSegmentValue(index, cmd.rData, cmd.reverseKey); dataList.add(dsv); // Process waiting peek and take commands for (Iterator<Command> iter = waitList.iterator(); iter.hasNext(); ) {
--- a/src/main/java/alice/datasegment/DataSegmentValue.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/datasegment/DataSegmentValue.java Sat Nov 22 12:08:24 2014 +0900 @@ -11,5 +11,5 @@ this.rData = rData; this.from = reverseKey; } - + }
--- a/src/main/java/alice/datasegment/MulticastDataSegmentManager.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/datasegment/MulticastDataSegmentManager.java Sat Nov 22 12:08:24 2014 +0900 @@ -30,7 +30,7 @@ DatagramChannel dcs = createDatagramChannel(mAddr, port, nis); SocketAddress sAddrs = new InetSocketAddress(mAddr,port); - connection = new MulticastConnection(dcs, sAddrs); // sender + connection = new MulticastConnection(dcs, sAddrs); // sender new IncomingUdpConnection((MulticastConnection) connection, receiver, this).start(); new OutboundTcpConnection(connection).start(); // OutboundUdpConnection sender @@ -63,5 +63,5 @@ e.printStackTrace(); } return dc; - } + } }
--- a/src/main/java/alice/datasegment/ReceiveData.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/datasegment/ReceiveData.java Sat Nov 22 12:08:24 2014 +0900 @@ -12,7 +12,7 @@ public class ReceiveData { private Object val; - + // both flag have to be true or false except DataSegment is byteArray; private boolean compressed = false; private boolean serialized = false; @@ -113,7 +113,7 @@ ByteArrayOutputStream os = new ByteArrayOutputStream(); InflaterOutputStream ios = new InflaterOutputStream(os, inflater); ios.write(input); - ios.finish(); + ios.finish(); return os.toByteArray(); }
--- a/src/main/java/alice/datasegment/RemoteDataSegmentManager.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/datasegment/RemoteDataSegmentManager.java Sat Nov 22 12:08:24 2014 +0900 @@ -42,7 +42,7 @@ } } while (connect); new IncomingTcpConnection(connection, manager, reverseKey).start(); - new OutboundTcpConnection(connection).start(); + new OutboundTcpConnection(connection).start(); } }.start(); } @@ -57,7 +57,7 @@ if (option.isQuick()){ connection.write(cmd); // put command is executed right now } else { - connection.sendCommand(cmd); // put command on the transmission thread + connection.sendCommand(cmd); // put command on the transmission thread } if (logger.isDebugEnabled()) logger.debug(cmd.getCommandString());
--- a/src/main/java/alice/test/codesegment/api/TakeCodeSegment.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/codesegment/api/TakeCodeSegment.java Sat Nov 22 12:08:24 2014 +0900 @@ -10,7 +10,7 @@ public TakeCodeSegment(String key){ this.ds1.setKey(key); - } + } @Override public void run() { new TakeCodeSegment(ds1.key);
--- a/src/main/java/alice/test/codesegment/local/bitonicsort/DataList.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/codesegment/local/bitonicsort/DataList.java Sat Nov 22 12:08:24 2014 +0900 @@ -25,7 +25,7 @@ } public void swap(int i, int j){ - int tmp = table[i]; + int tmp = table[i]; table[i] = table[j]; table[j] = tmp; } @@ -54,22 +54,22 @@ } public static void merge(DataList list1, DataList list2) { - int[] t1 = list1.table; - int[] t2 = list2.table; + int[] t1 = list1.table; + int[] t2 = list2.table; int[] t0 = list1.table.clone(); // copy to avoid destroy t1 int i = 0, j= 0,n=0; while (i< t0.length) { if (n>=t1.length) { // switch to the second list t1 = t2; n = 0; } - if (j>=t2.length || t0[i] < t2[j]) { + if (j>=t2.length || t0[i] < t2[j]) { t1[n] = t0[i]; // including when j reaches end of t2 i++; n++; } else { t1[n] = t2[j]; j++; n++; } - } + } } }
--- a/src/main/java/alice/test/codesegment/local/bitonicsort/SortConfig.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/codesegment/local/bitonicsort/SortConfig.java Sat Nov 22 12:08:24 2014 +0900 @@ -13,9 +13,9 @@ public SortConfig(String[] args){ for (int i=0;i<args.length; i++){ if ("-l".equals(args[i])){ - length = Integer.parseInt(args[++i]); + length = Integer.parseInt(args[++i]); } else if ("-b".equals(args[i])){ - MAX_BLOCK_SIZE = Integer.parseInt(args[++i]); + MAX_BLOCK_SIZE = Integer.parseInt(args[++i]); } } if (length<MAX_BLOCK_SIZE) MAX_BLOCK_SIZE = length;
--- a/src/main/java/alice/test/codesegment/local/bitonicsort/SortPhase.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/codesegment/local/bitonicsort/SortPhase.java Sat Nov 22 12:08:24 2014 +0900 @@ -37,7 +37,7 @@ if (count%2==0&&i==0){ ods.flip(info1); // first block index is less than others. So put data twice. } else if (count%2==0&&info.lastFlag){ - ods.flip(info2); // Same reason + ods.flip(info2); // Same reason } ods.flip(info1);
--- a/src/main/java/alice/test/codesegment/local/wordcount/ReadFileTest.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/codesegment/local/wordcount/ReadFileTest.java Sat Nov 22 12:08:24 2014 +0900 @@ -32,7 +32,7 @@ System.out.print(range.array); // ods System.out.println(range.nextchar); range = new Range(array); - } + } System.out.println(i); } catch (FileNotFoundException e) { System.out.println("file was not found");
--- a/src/main/java/alice/test/codesegment/local/wordcount/SeparateArray.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/codesegment/local/wordcount/SeparateArray.java Sat Nov 22 12:08:24 2014 +0900 @@ -16,7 +16,7 @@ } @Override - public void run() { + public void run() { // cpu分だけTaskをあらかじめ作成 int cpu_num = Runtime.getRuntime().availableProcessors(); for (int cnt =0;cnt < cpu_num;cnt++){ @@ -33,14 +33,14 @@ int size = conf.division * 1024; // Kbyte Range range = new Range(size); int check = br.read(range.array); - for (;check!=-1;i++){ + for (;check!=-1;i++){ char[] array; array = new char[size]; check = br.read(array); range.nextchar = array[0]; ods.put("array", range); range = new Range(array); - } + } new CorrectResult(i); } catch (FileNotFoundException e) { System.exit(1);
--- a/src/main/java/alice/test/codesegment/local/wordcount/WordConfig.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/codesegment/local/wordcount/WordConfig.java Sat Nov 22 12:08:24 2014 +0900 @@ -8,9 +8,9 @@ public WordConfig(String[] args) { for (int i=0;i<args.length; i++){ if ("-f".equals(args[i])){ - filename = args[++i]; + filename = args[++i]; } else if ("-d".equals(args[i])){ - division = Integer.parseInt(args[++i]); + division = Integer.parseInt(args[++i]); } }
--- a/src/main/java/alice/test/codesegment/local/wordcount/WordCount.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/codesegment/local/wordcount/WordCount.java Sat Nov 22 12:08:24 2014 +0900 @@ -20,7 +20,7 @@ int line_num = 0; int i = 0; for (; i < r.array.length; i++) { - if (r.array[i] == 0x20) { // 空白 + if (r.array[i] == 0x20) { // 空白 word_flag = 1; } else if (r.array[i] == 0x0A) { // 改行 line_num += 1;
--- a/src/main/java/alice/test/concurrent/AliceFinish.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/concurrent/AliceFinish.java Sat Nov 22 12:08:24 2014 +0900 @@ -11,7 +11,7 @@ public Receiver ds1 = ids.create(CommandType.TAKE); public AliceFinish(int threadNum) { - this.num = threadNum; + this.num = threadNum; } @Override
--- a/src/main/java/alice/test/reflection/CSTemplate.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/reflection/CSTemplate.java Sat Nov 22 12:08:24 2014 +0900 @@ -10,7 +10,7 @@ @Override public void run() { - + } }
--- a/src/main/java/alice/test/reflection/CloseEventManager.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/reflection/CloseEventManager.java Sat Nov 22 12:08:24 2014 +0900 @@ -56,7 +56,7 @@ CtConstructor[] ccArray = cs.getConstructors(); CtConstructor cc = null; - for (int i = 0; i < ccArray.length; i++){ + for (int i = 0; i < ccArray.length; i++){ if (ccArray[i].getName().equals(clazz.getSimpleName())){ cc = ccArray[i]; break; @@ -65,7 +65,7 @@ } String metaSetKey = metaFieldName+".setKey(\"TEST\");"; - cc.insertAfter(metaSetKey); + cc.insertAfter(metaSetKey); cs.setName(metaName); Class<?> metaClass = cs.toClass();
--- a/src/main/java/alice/test/reflection/DisposeManager.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/reflection/DisposeManager.java Sat Nov 22 12:08:24 2014 +0900 @@ -11,7 +11,7 @@ import javassist.bytecode.AccessFlag; public class DisposeManager { - private static DisposeManager instance = new DisposeManager(); + private static DisposeManager instance = new DisposeManager(); private ClassPool cp = ClassPool.getDefault(); private DisposeManager(){}
--- a/src/main/java/alice/test/reflection/MetaCodeSegment.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/reflection/MetaCodeSegment.java Sat Nov 22 12:08:24 2014 +0900 @@ -21,7 +21,7 @@ System.out.println("index = " + arg1.index); System.out.println("data = " + arg1.getVal()); System.out.println(((Value)arg1.getVal()).getType()); - System.out.println(MetaCodeSegment.class); + System.out.println(MetaCodeSegment.class); if (arg1.index == 10) { System.exit(0);
--- a/src/main/java/alice/test/reflection/ReflectionTest.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/reflection/ReflectionTest.java Sat Nov 22 12:08:24 2014 +0900 @@ -43,7 +43,7 @@ m.insertAfter("new alice.test.reflection.CSTemplate();"); m.insertAfter("ods.update(\"key1\", \"String Data\");"); - Class<?> clazz = tep.toClass(); // load Class + Class<?> clazz = tep.toClass(); // load Class @SuppressWarnings("unused") CSTemplate cs = (CSTemplate)clazz.newInstance(); // create instance
--- a/src/main/java/alice/test/topology/aquarium/CheckMyName.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/CheckMyName.java Sat Nov 22 12:08:24 2014 +0900 @@ -32,7 +32,7 @@ if (type.equals("cli")){ System.out.println("cli"+num); - new TakeMynum(); + new TakeMynum(); }else if (type.equals("node")){ System.out.println("node"+num); if (num != 0){ @@ -61,7 +61,7 @@ Random rnd = new Random(); int tmp = rnd.nextInt(3); int rand = tmp + 1; - ods.update(key, new FishPoint( (float)rand, + ods.update(key, new FishPoint( (float)rand, -(float)Math.random(), -(float)Math.random())); new SetLocation(new MakeObject(frame), key, 0); new CheckLocalIndex(key,1); @@ -71,9 +71,9 @@ key = "fish"+i; if (num == 2) new AutoIncrement(key,0); Random rnd = new Random(); - int tmp = rnd.nextInt(3); + int tmp = rnd.nextInt(3); int rand = tmp + 3; - ods.update(key, new FishPoint( (float)rand, + ods.update(key, new FishPoint( (float)rand, (float)Math.random(), -(float)Math.random())); new SetLocation(new MakeObject(frame), key, 0); new CheckLocalIndex(key,1); @@ -84,10 +84,10 @@ if (num == 3) new AutoIncrement(key,0); Random rnd = new Random(); - int tmp = rnd.nextInt(3); + int tmp = rnd.nextInt(3); int rand = tmp + 5; - ods.update(key, new FishPoint( (float)rand, + ods.update(key, new FishPoint( (float)rand, -(float)Math.random(), (float)Math.random())); new SetLocation(new MakeObject(frame), key, 0); new CheckLocalIndex(key,1);
--- a/src/main/java/alice/test/topology/aquarium/KeyInputCodeSegment.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/KeyInputCodeSegment.java Sat Nov 22 12:08:24 2014 +0900 @@ -16,7 +16,7 @@ switch(event.getKeyCode()) { case 37: // left - new SendLocation(-0.1f,0.0f,0.0f); + new SendLocation(-0.1f,0.0f,0.0f); break; case 38: // up new SendLocation(0.0f,0.1f,0.0f);
--- a/src/main/java/alice/test/topology/aquarium/MakeFrame.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/MakeFrame.java Sat Nov 22 12:08:24 2014 +0900 @@ -30,7 +30,7 @@ private ObjectList list = new ObjectList(); public MakeFrame(String str,float x) { - System.loadLibrary("jawt"); + System.loadLibrary("jawt"); frame = new JFrame(str); frame.setSize(F_SIZE_X, F_SIZE_Y); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -65,7 +65,7 @@ } catch (IOException e) { e.printStackTrace(); } - ImageComponent2D image = + ImageComponent2D image = new ImageComponent2D(ImageComponent2D.FORMAT_RGBA8,img); Background background = new Background(image); background.setImageScaleMode(Background.SCALE_FIT_ALL);
--- a/src/main/java/alice/test/topology/aquarium/MakeObject.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/MakeObject.java Sat Nov 22 12:08:24 2014 +0900 @@ -22,7 +22,7 @@ public class MakeObject { - private Transform3D transform; + private Transform3D transform; private TransformGroup transform_group; private ViewChange canvas; private Matrix4d matrix; @@ -60,13 +60,13 @@ transform_group.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); transform_group.addChild(img.getSceneGroup()); scene.addChild(transform_group); - return scene; + return scene; } // no use method public Appearance createAppearance(){ Appearance app = new Appearance(); - Image image = null; + Image image = null; Toolkit toolkit = Toolkit.getDefaultToolkit(); URL url = getClass().getClassLoader().getResource("fish.jpg"); image = toolkit.getImage(url);
--- a/src/main/java/alice/test/topology/aquarium/MouseViewEvent.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/MouseViewEvent.java Sat Nov 22 12:08:24 2014 +0900 @@ -25,7 +25,7 @@ v.camera_xz = v.distance * (float)Math.cos(v.theta); v.camera_x = v.camera_xz * (float)Math.sin(v.phi); - v.camera_z = v.camera_xz * (float)Math.cos(v.phi); + v.camera_z = v.camera_xz * (float)Math.cos(v.phi); v.Vector_camera_pos.x = v.camera_x; v.Vector_camera_pos.y = v.camera_y; v.Vector_camera_pos.z = v.camera_z; @@ -41,12 +41,12 @@ pre_x = event.getX(); pre_y = event.getY(); - } + } @Override public void mouseMoved(MouseEvent event) { pre_x = event.getX(); - pre_y = event.getY(); + pre_y = event.getY(); } }
--- a/src/main/java/alice/test/topology/aquarium/TakePnum.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/TakePnum.java Sat Nov 22 12:08:24 2014 +0900 @@ -17,7 +17,7 @@ @Override public void run() { - ods.update("parent", "num", + ods.update("parent", "num", this.pnum.asInteger()+this.mynum.asInteger()); }
--- a/src/main/java/alice/test/topology/aquarium/fx/AddObject.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/AddObject.java Sat Nov 22 12:08:24 2014 +0900 @@ -9,8 +9,8 @@ public class AddObject extends CodeSegment { // add Object on javaFx Scene - private Receiver info = ids.create(CommandType.TAKE); // objectList - private Receiver info1 = ids.create(CommandType.TAKE); // fish Object made from CreateObject CS + private Receiver info = ids.create(CommandType.TAKE); // objectList + private Receiver info1 = ids.create(CommandType.TAKE); // fish Object made from CreateObject CS private Receiver info2 = ids.create(CommandType.PEEK); // node name private boolean executed = false; @@ -44,7 +44,7 @@ System.out.println(obj.getId()+" add"); ods.put(obj.getId()+"Fish", obj); - // controlled own fish + // controlled own fish if (myName.equals(obj.getId())){ new CalculatePosition(obj.getId()+"FishdiffP"); }
--- a/src/main/java/alice/test/topology/aquarium/fx/Aquarium.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/Aquarium.java Sat Nov 22 12:08:24 2014 +0900 @@ -25,14 +25,14 @@ @Override public void start(Stage primaryStage) throws IOException { String myName = getParameters().getRaw().get(0); // name - primaryStage.setTitle("Aquarium "+ myName); + primaryStage.setTitle("Aquarium "+ myName); primaryStage.setResizable(false); primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>(){ @Override public void handle(WindowEvent event) { // should send finish DataSegment System.exit(0); - } + } }); Scene scene = new Scene(createContent());
--- a/src/main/java/alice/test/topology/aquarium/fx/AquariumConfig.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/AquariumConfig.java Sat Nov 22 12:08:24 2014 +0900 @@ -5,7 +5,7 @@ public class AquariumConfig extends TopologyNodeConfig { public String type = "DEFAULT"; - + public AquariumConfig(String[] args) { super(args); for (int i = 0; i< args.length; i++) {
--- a/src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/CalculatePosition.java Sat Nov 22 12:08:24 2014 +0900 @@ -6,8 +6,8 @@ public class CalculatePosition extends CodeSegment { - private Receiver info = ids.create(CommandType.TAKE); // diff fish position value - private Receiver info1 = ids.create(CommandType.TAKE); // absolute fish position value + private Receiver info = ids.create(CommandType.TAKE); // diff fish position value + private Receiver info1 = ids.create(CommandType.TAKE); // absolute fish position value private Receiver info2 = ids.create(CommandType.PEEK); public CalculatePosition(String key){ @@ -25,7 +25,7 @@ afp.setX(afp.getX() + dfp.getX()); afp.setY(afp.getY() + dfp.getY()); - afp.setZ(afp.getZ() + dfp.getZ()); + afp.setZ(afp.getZ() + dfp.getZ()); ods.update(info1.key, afp); FishInfo fishInfo = new FishInfo(afp.getX(),afp.getY(),afp.getZ());
--- a/src/main/java/alice/test/topology/aquarium/fx/CheckAllFishInfoExist.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/CheckAllFishInfoExist.java Sat Nov 22 12:08:24 2014 +0900 @@ -18,7 +18,7 @@ // this CS check all fish object exist in scene private Receiver info = ids.create(CommandType.TAKE); // fishInfoList - private Receiver info1 = ids.create(CommandType.PEEK); + private Receiver info1 = ids.create(CommandType.PEEK); public CheckAllFishInfoExist(){ info.setKey("receiveRegisteredList"); @@ -41,7 +41,7 @@ if (info.name.equals(n.getId())) { exist = true; break; - } + } } if (!exist) {
--- a/src/main/java/alice/test/topology/aquarium/fx/CheckMyName.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/CheckMyName.java Sat Nov 22 12:08:24 2014 +0900 @@ -31,12 +31,12 @@ // node1 median : 10 // node2 median : 20 - if (num == 0){ + if (num == 0){ // only root node create fishInfoList registered all fishInfo // fishInfoList send children for checking all Fish object in own scene new RegisterList(); ods.put("registeredList", new ArrayList<FishInfo>()); - } + } new CheckAllFishInfoExist();
--- a/src/main/java/alice/test/topology/aquarium/fx/CreateObject.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/CreateObject.java Sat Nov 22 12:08:24 2014 +0900 @@ -17,8 +17,8 @@ public class CreateObject extends CodeSegment{ - private Receiver info = ids.create(CommandType.TAKE); // fishInfo - private Receiver info1 = ids.create(CommandType.PEEK); // fishInfo + private Receiver info = ids.create(CommandType.TAKE); // fishInfo + private Receiver info1 = ids.create(CommandType.PEEK); // fishInfo public CreateObject(){ info.setKey("fishData"); @@ -68,7 +68,7 @@ Node[] node = colImporter.getImport(); obj.getChildren().add(node[0]); } - + public String getResourceUrl() { String type = info1.asString(); System.out.println(type);
--- a/src/main/java/alice/test/topology/aquarium/fx/FishType.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/FishType.java Sat Nov 22 12:08:24 2014 +0900 @@ -1,16 +1,16 @@ package alice.test.topology.aquarium.fx; public enum FishType { - + DEFAULT("objects/seymourplane-150-im.dae"), TUNA("objects/TUNA.dae"); - + private String url; - + FishType(String url){ this.url = url; } - + public String getUrl() { return url; }
--- a/src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/aquarium/fx/SetTranslate.java Sat Nov 22 12:08:24 2014 +0900 @@ -41,7 +41,7 @@ executed = false; new SetTranslate(info.key); - } + } } }
--- a/src/main/java/alice/test/topology/fish/WidthReceiver.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/fish/WidthReceiver.java Sat Nov 22 12:08:24 2014 +0900 @@ -14,7 +14,7 @@ public class WidthReceiver extends CodeSegment { public Receiver widths = ids.create(CommandType.TAKE); - public Receiver routing = ids.create(CommandType.PEEK); + public Receiver routing = ids.create(CommandType.PEEK); @Override public void run() {
--- a/src/main/java/alice/test/topology/share/AutoIncrement.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/share/AutoIncrement.java Sat Nov 22 12:08:24 2014 +0900 @@ -6,7 +6,7 @@ public class AutoIncrement extends CodeSegment { - public Receiver position = ids.create(CommandType.PEEK); + public Receiver position = ids.create(CommandType.PEEK); public AutoIncrement(String key,int index){ this.position.setKey(key, index);
--- a/src/main/java/alice/test/topology/share/ShareConfig.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/test/topology/share/ShareConfig.java Sat Nov 22 12:08:24 2014 +0900 @@ -6,7 +6,7 @@ public ShareConfig(String[] args){ super(args); - } + } }
--- a/src/main/java/alice/topology/HostMessage.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/HostMessage.java Sat Nov 22 12:08:24 2014 +0900 @@ -9,7 +9,7 @@ public int port; public String connectionName; public String reverseName; - + public String absName; public String remoteAbsName; public String cookie; // MD5
--- a/src/main/java/alice/topology/manager/CloseEventCodeSegment.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/manager/CloseEventCodeSegment.java Sat Nov 22 12:08:24 2014 +0900 @@ -6,13 +6,13 @@ import alice.datasegment.Receiver; public abstract class CloseEventCodeSegment extends CodeSegment { - + private Receiver metaInfo = ids.create(CommandType.PEEK); - + public CloseEventCodeSegment(){ metaInfo.setKey("disconnect"); } - + public ConnectionInfo getConnectionInfo() { return metaInfo.asClass(ConnectionInfo.class); }
--- a/src/main/java/alice/topology/manager/ComingServiceHosts.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/manager/ComingServiceHosts.java Sat Nov 22 12:08:24 2014 +0900 @@ -43,19 +43,19 @@ DataSegment.connect(nodeName, "", host.name, host.port); ods.put(nodeName, "host", nodeName); ods.put(nodeName, "cookie", cookie); - + absCookieTable.put(cookie, nodeName); ods.put(info4.key, absCookieTable); ods.update(info1.key, comingHostCount+1); - + for (int i=1;i < BINATY_TREE+1; i++) { // child number is own number(comingHostCount) * 2 add one or two - int num = BINATY_TREE * comingHostCount+i; + int num = BINATY_TREE * comingHostCount+i; HostMessage newHost = new HostMessage(host.name, host.port, "parent", "child"+(i-1)); newHost.absName = nodeName; newHost.remoteAbsName = "node"+num; parentInfo.put(newHost.remoteAbsName, newHost); - + ods.put("nodeInfo", newHost); ods.put(newHost.remoteAbsName, newHost); new RecodeTopology(); @@ -65,11 +65,11 @@ HostMessage newHost = new HostMessage(host.name, host.port, parent.reverseName, parent.connectionName); newHost.absName = nodeName; newHost.remoteAbsName = parent.absName; - + ods.put("nodeInfo", newHost); ods.put(parent.absName, newHost); new RecodeTopology(); - } + } ods.put("nodeConnectionInfo", parentInfo); ods.put(nodeName, ValueFactory.createNilValue());
--- a/src/main/java/alice/topology/manager/StartTopologyManager.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/manager/StartTopologyManager.java Sat Nov 22 12:08:24 2014 +0900 @@ -31,7 +31,7 @@ public void run() { new CheckComingHost(); ods.put("absCookieTable", new HashMap<String, String>()); - + if (!conf.extendTopology) { LinkedList<String> nodeNames = new LinkedList<String>(); HashMap<String, LinkedList<NodeInfo>> topology = new HashMap<String, LinkedList<NodeInfo>>(); @@ -78,21 +78,21 @@ logger.error("File format error: " + conf.confFilePath); e.printStackTrace(); } - + // for recode topology information // cookie List ods.put("running", false); ods.put("resultParse", topology); ods.put("nodeNames", nodeNames); - + new IncomingHosts(); ConfigWaiter cs3 = new ConfigWaiter(nodeNum); cs3.done.setKey("local", "done"); - + } else { ods.put("running", true); - + HashMap<String,HostMessage> parentInfo = new HashMap<String,HostMessage>(); int cominghostCount = 0; ods.put("nodeConnectionInfo", parentInfo); @@ -100,7 +100,7 @@ new ComingServiceHosts(); } - ods.put("topology", new HashMap<String, LinkedList<HostMessage>>()); + ods.put("topology", new HashMap<String, LinkedList<HostMessage>>()); ods.put("createdList", new LinkedList<String>()); new CreateHash(); }
--- a/src/main/java/alice/topology/manager/keeparive/CreateSchedule.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/CreateSchedule.java Sat Nov 22 12:08:24 2014 +0900 @@ -5,7 +5,7 @@ import alice.datasegment.Receiver; public class CreateSchedule extends CodeSegment{ - private Receiver info1 = ids.create(CommandType.TAKE); // WaitingList + private Receiver info1 = ids.create(CommandType.TAKE); // WaitingList private Receiver info2 = ids.create(CommandType.TAKE); // TaskInfo public CreateSchedule(){
--- a/src/main/java/alice/topology/manager/keeparive/ListManager.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/ListManager.java Sat Nov 22 12:08:24 2014 +0900 @@ -36,7 +36,7 @@ int cnt = 0; for (TaskInfo info : list){ if (info.getSleepTime() < newInfo.getSleepTime()){ - newInfo.setSleepTime(newInfo.getSleepTime() - info.getSleepTime()); + newInfo.setSleepTime(newInfo.getSleepTime() - info.getSleepTime()); } else if (info.getSleepTime() == newInfo.getSleepTime()){ // newInfo.getSleepTime() - info.getSleepTime() must be Zero newInfo.setSleepTime(0); @@ -66,7 +66,7 @@ } else { cnt++; } - } + } return matchFlag; }
--- a/src/main/java/alice/topology/manager/keeparive/RespondPing.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/RespondPing.java Sat Nov 22 12:08:24 2014 +0900 @@ -19,10 +19,10 @@ System.out.print("ping from "+d.from); System.out.println(" Recieved time "+(d.time - pingedTime)); if (d.time - pingedTime > 60 * 1000){ - // need check, this connection is alive. may be close + // need check, this connection is alive. may be close DataSegment.get(d.from).shutdown(); } else { - // if nowTask close d.from's socket cancel. + // if nowTask close d.from's socket cancel. // if not remove close task in the Queue. TaskExecuter exec = TaskExecuter.getInstance(); TaskInfo task = new TaskInfo(TaskType.CLOSE);
--- a/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/manager/keeparive/TaskExecuter.java Sat Nov 22 12:08:24 2014 +0900 @@ -11,7 +11,7 @@ private boolean sleepFlag = false; private boolean skipFlag = false; private long startTime = 0; - private long remainingTime = 0; + private long remainingTime = 0; private static TaskExecuter instance = new TaskExecuter(); private TaskExecuter() {} @@ -80,7 +80,7 @@ } else { remainingTime = nowTask.getSleepTime() - (System.currentTimeMillis() - startTime); } - nowTask = null; + nowTask = null; notify(); } } @@ -90,7 +90,7 @@ skipFlag = true; remainingTime = 0; nowTask = null; - notify(); + notify(); } } @@ -120,7 +120,7 @@ if (nowTask.getType().equals(task.getType()) && nowTask.getManagerKey().equals(task.getManagerKey())){ return true; - } + } } return false; }
--- a/src/main/java/alice/topology/node/IncomingConnectionInfo.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/node/IncomingConnectionInfo.java Sat Nov 22 12:08:24 2014 +0900 @@ -30,13 +30,13 @@ } else { ods.put("cMember", hostInfo.connectionName); new CreateConnectionList(); - count++; - } - DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); + count++; + } + DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName); - + } - + IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, count); cs.hostInfo.setKey("manager", absName); }
--- a/src/main/java/alice/topology/node/SaveCookie.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/node/SaveCookie.java Sat Nov 22 12:08:24 2014 +0900 @@ -7,16 +7,16 @@ public class SaveCookie extends CodeSegment{ private Receiver info = ids.create(CommandType.PEEK); - + public SaveCookie(){ info.setKey("cookie"); } - + @Override public void run() { System.out.println(info.asString()); - + } - - + + }
--- a/src/main/java/alice/topology/node/StartTopologyNode.java Sat Nov 15 04:48:35 2014 +0900 +++ b/src/main/java/alice/topology/node/StartTopologyNode.java Sat Nov 22 12:08:24 2014 +0900 @@ -34,7 +34,7 @@ ods.put("manager", "host", host); ods.put("_CLIST", new ArrayList<String>()); - + IncomingAbstractHostName cs = new IncomingAbstractHostName(); cs.absName.setKey("local", "host");