# HG changeset patch # User one # Date 1364380713 -32400 # Node ID 21bd8af1cf2693cd4426661fa7179cc06bdfe568 # Parent 1fd7067f00447bfab7be53f719a17ffb4e4ec16d change asClass method diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/codesegment/ReceiveLocalData.java --- a/src/alice/codesegment/ReceiveLocalData.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/codesegment/ReceiveLocalData.java Wed Mar 27 19:38:33 2013 +0900 @@ -32,7 +32,7 @@ } @SuppressWarnings("unchecked") - public T asClass(Receiver receiver, Class clazz) { + public T asClass(Class clazz) { return (T) obj; } @@ -51,4 +51,5 @@ public Object getObj() { return obj; } + } diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/datasegment/ReceiveRemoteData.java --- a/src/alice/datasegment/ReceiveRemoteData.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/datasegment/ReceiveRemoteData.java Wed Mar 27 19:38:33 2013 +0900 @@ -46,7 +46,7 @@ return null; } - public T asClass(Receiver receiver, Class clazz) { + public T asClass(Class clazz) { try { return SingletonMessage.getInstance().convert(val, clazz); } catch (IOException e) { diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/datasegment/Receiver.java --- a/src/alice/datasegment/Receiver.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/datasegment/Receiver.java Wed Mar 27 19:38:33 2013 +0900 @@ -72,8 +72,8 @@ return data.getVal(); } - public T asClass(Receiver receiver, Class clazz) { - return data.asClass(receiver, clazz); + public T asClass(Class clazz) { + return data.asClass(clazz); } public int asInteger(Receiver receiver) { diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/datasegment/ReceiverData.java --- a/src/alice/datasegment/ReceiverData.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/datasegment/ReceiverData.java Wed Mar 27 19:38:33 2013 +0900 @@ -9,7 +9,7 @@ public int asInteger(Receiver receiver); public Float asFloat(Receiver receiver) ; public ArrayValue asArray(Receiver receiver); - public T asClass(Receiver receiver, Class clazz); + public T asClass(Class clazz); public Value getVal(); public Object getObj(); diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/test/codesegment/local/bitonicsort/MakeData.java --- a/src/alice/test/codesegment/local/bitonicsort/MakeData.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/MakeData.java Wed Mar 27 19:38:33 2013 +0900 @@ -19,8 +19,8 @@ @Override public void run() { // This conversion over head should be remove. - SortConfig conf = info1.asClass(info1, SortConfig.class); - DataList list = info2.asClass(info2, DataList.class); + SortConfig conf = info1.asClass(SortConfig.class); + DataList list = info2.asClass(DataList.class); int size = conf.getLength(); Random rnd = new Random(); for (int i = 0; i < size; i++){ diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/test/codesegment/local/bitonicsort/OddPhase.java --- a/src/alice/test/codesegment/local/bitonicsort/OddPhase.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/OddPhase.java Wed Mar 27 19:38:33 2013 +0900 @@ -27,15 +27,15 @@ @Override public void run() { - RangeInfo info = info0.asClass(info0, RangeInfo.class); + RangeInfo info = info0.asClass(RangeInfo.class); int sort_count = info5.asInteger(info5); int count = info6.asInteger(info6); //System.out.println("count is " +count); int i = info.range; if (countmax){ fp.setXYZ(min, fp.getY(), fp.getZ()); } else if (fp.getX()+0.01< min){ diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/test/topology/aquarium/CheckLocalIndex.java --- a/src/alice/test/topology/aquarium/CheckLocalIndex.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/test/topology/aquarium/CheckLocalIndex.java Wed Mar 27 19:38:33 2013 +0900 @@ -17,7 +17,7 @@ @Override public void run() { - RoutingTable rt = this.list.data.asClass(this.list, RoutingTable.class); + RoutingTable rt = this.list.asClass(RoutingTable.class); for (Routing r : rt.table) { if (!r.name.equals(this.data.from)){ ods.update(r.name, data.key, this.data.getVal()); diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/test/topology/aquarium/SendLocation.java --- a/src/alice/test/topology/aquarium/SendLocation.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/test/topology/aquarium/SendLocation.java Wed Mar 27 19:38:33 2013 +0900 @@ -21,7 +21,7 @@ @Override public void run() { - FishPoint fp = this.position.data.asClass(this.position, FishPoint.class); + FishPoint fp = this.position.data.asClass(FishPoint.class); fp.setXYZ(fp.getX()+x, fp.getY()+y, fp.getZ()+z); ods.update("local", "fish", fp); diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/test/topology/aquarium/SetLocation.java --- a/src/alice/test/topology/aquarium/SetLocation.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/test/topology/aquarium/SetLocation.java Wed Mar 27 19:38:33 2013 +0900 @@ -19,7 +19,7 @@ @Override public void run(){ - FishPoint fp = this.position.data.asClass(this.position, FishPoint.class); + FishPoint fp = this.position.asClass(FishPoint.class); obj.setLocation(fp.getX(), fp.getY(), fp.getZ()); new SetLocation(obj, position.key, position.index, range); diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/test/topology/fish/AsignStartX.java --- a/src/alice/test/topology/fish/AsignStartX.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/test/topology/fish/AsignStartX.java Wed Mar 27 19:38:33 2013 +0900 @@ -19,7 +19,7 @@ public void run() { System.out.println("AsignStartX: " + startX); - RoutingTable routing = this.routing.asClass(this.routing, RoutingTable.class); + RoutingTable routing = this.routing.asClass(RoutingTable.class); int x = startX; System.out.println("RoutingTable: " + this.routing.getVal()); if (this.index >= this.routing.index) { diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/test/topology/fish/WidthReceiver.java --- a/src/alice/test/topology/fish/WidthReceiver.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/test/topology/fish/WidthReceiver.java Wed Mar 27 19:38:33 2013 +0900 @@ -16,7 +16,7 @@ public void run() { int width = this.widths.asInteger(this.widths); String from = this.widths.from; - RoutingTable routing = this.routing.asClass(this.routing, RoutingTable.class); + RoutingTable routing = this.routing.asClass(RoutingTable.class); Routing newRouting = new Routing(from, width); boolean update = false; for (Routing r : routing.table) { diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/test/topology/share/CheckLocalIndex.java --- a/src/alice/test/topology/share/CheckLocalIndex.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/test/topology/share/CheckLocalIndex.java Wed Mar 27 19:38:33 2013 +0900 @@ -22,7 +22,7 @@ @Override public void run() { - RoutingTable rt = this.list.data.asClass(this.list, RoutingTable.class); + RoutingTable rt = this.list.asClass(RoutingTable.class); int count = 0; boolean flag = false; for (Routing r : rt.table) { diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/test/topology/share/LookUpData.java --- a/src/alice/test/topology/share/LookUpData.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/test/topology/share/LookUpData.java Wed Mar 27 19:38:33 2013 +0900 @@ -24,7 +24,7 @@ @Override public void run(){ new LookUpData(this.key,this.data.index); - DataInfo di = data.data.asClass(data, DataInfo.class); + DataInfo di = data.data.asClass(DataInfo.class); System.out.println(System.nanoTime()-di.getTime()); } diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/topology/manager/IncomingHosts.java --- a/src/alice/topology/manager/IncomingHosts.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/topology/manager/IncomingHosts.java Wed Mar 27 19:38:33 2013 +0900 @@ -24,7 +24,7 @@ @Override public void run() { - HostMessage host = this.host.data.asClass(this.host, HostMessage.class); + HostMessage host = this.host.asClass(HostMessage.class); String nodeName = nodeNames.poll(); // Manager connect to Node DataSegment.connect(nodeName, "", host.name, host.port); diff -r 1fd7067f0044 -r 21bd8af1cf26 src/alice/topology/node/IncomingConnectionInfo.java --- a/src/alice/topology/node/IncomingConnectionInfo.java Wed Mar 27 18:35:43 2013 +0900 +++ b/src/alice/topology/node/IncomingConnectionInfo.java Wed Mar 27 19:38:33 2013 +0900 @@ -24,7 +24,7 @@ return; } - HostMessage hostInfo = this.hostInfo.asClass(this.hostInfo, HostMessage.class); + HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class); DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port); ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName);