Mercurial > hg > Members > tatsuki > jungle-bench
comparison src/main/java/example/WriteThread.java @ 8:442463aa27e5
miss Spell revision
author | one |
---|---|
date | Tue, 01 Apr 2014 18:28:34 +0900 |
parents | 24fca21a576e |
children |
comparison
equal
deleted
inserted
replaced
7:4e1f8f434648 | 8:442463aa27e5 |
---|---|
14 public static final String key = "name"; | 14 public static final String key = "name"; |
15 public String valueString = "tatsuki"; | 15 public String valueString = "tatsuki"; |
16 public ByteBuffer value = ByteBuffer.wrap(valueString.getBytes()); | 16 public ByteBuffer value = ByteBuffer.wrap(valueString.getBytes()); |
17 Jungle j; | 17 Jungle j; |
18 NodePath childPath; | 18 NodePath childPath; |
19 int roopCount; | 19 int loopCount; |
20 int num; | 20 int num; |
21 | 21 |
22 WriteThread(Jungle j, NodePath childPath, int roopCount, int num) { | 22 WriteThread(Jungle j, NodePath childPath, int loopCount, int num) { |
23 this.num = num; | 23 this.num = num; |
24 this.valueString = this.valueString + Integer.toString(num); | 24 this.valueString = this.valueString + Integer.toString(num); |
25 this.value = ByteBuffer.wrap(valueString.getBytes()); | 25 this.value = ByteBuffer.wrap(valueString.getBytes()); |
26 this.roopCount = roopCount; | 26 this.loopCount = loopCount; |
27 this.j = j; | 27 this.j = j; |
28 this.childPath = childPath; | 28 this.childPath = childPath; |
29 } | 29 } |
30 | 30 |
31 public void run() { | 31 public void run() { |
32 JungleTree tree = j.getTreeByName("tree");// 名前を取得 | 32 JungleTree tree = j.getTreeByName("tree");// 名前を取得 |
33 Either<Error, JungleTreeEditor> either; | 33 Either<Error, JungleTreeEditor> either; |
34 System.out.println("roopCount = " + roopCount); | 34 System.out.println("loopCount = " + loopCount); |
35 long t1 = System.currentTimeMillis();// 時間の測定開始 | 35 long t1 = System.currentTimeMillis();// 時間の測定開始 |
36 | 36 |
37 for (int count = 0; count < roopCount; count++) { | 37 for (int count = 0; count < loopCount; count++) { |
38 do { | 38 do { |
39 JungleTreeEditor editor = tree.getTreeEditor();// Treeのeditorを作成 | 39 JungleTreeEditor editor = tree.getTreeEditor();// Treeのeditorを作成 |
40 either = editor.putAttribute(childPath, key, value); | 40 either = editor.putAttribute(childPath, key, value); |
41 if (either.isA()) { | 41 if (either.isA()) { |
42 Assert.fail(); | 42 Assert.fail(); |