Mercurial > hg > Database > Alice
diff src/main/java/alice/test/codesegment/api/StartCodeSegment.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children | aefbe41fcf12 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/test/codesegment/api/StartCodeSegment.java Wed Apr 16 18:26:07 2014 +0900 @@ -0,0 +1,54 @@ +package alice.test.codesegment.api; + +import java.util.Random; + +import alice.codesegment.CodeSegment; +import alice.test.codesegment.local.bitonicsort.DataList; + +public class StartCodeSegment extends CodeSegment { + String[] args; + public static int count = 1; + public static int cnt = 1; + public static long t = 0; + + + public StartCodeSegment(String[] args){ + this.args = args; + } + + @Override + public void run() { + for (String arg : args) { + if ("-update".equals(arg)) { + UpdateCodeSegment cs1 = new UpdateCodeSegment(); + cs1.ds1.setKey("key"); + int[] array = new int[65536]; + array[0] = 0; + ods.update("local", "key", array); + + } else if ("-put".equals(arg)) { + new PutCodeSegment().execute(); + + } else if ("-take".equals(arg)) { + new PutCodeSegment().execute(); + new TakeCodeSegment("num"); + + } else if ("-flip".equals(arg)) { + new FlipCodeSegment("key").execute(); + } else if ("-peek".equals(arg)) { + System.out.println("start peek Test"); + String key = "peek"; + int size = 100000; + DataList list = new DataList(size); + Random rnd = new Random(); + for (int cnt = 0; cnt < size; cnt++) { + list.table[cnt] = rnd.nextInt(100000) + 10; + } + ods.put(key, list); + new PeekCodeSegment(key); + } + } + + } + +}