view src/alice/test/codesegment/api/StartCodeSegment.java @ 238:e4a5da56b394

minor change
author sugi
date Mon, 08 Apr 2013 15:29:24 +0900
parents bc451bb72d5a
children 4074077d118d
line wrap: on
line source

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 (int i = 0;i<args.length;i++){
			if ("-update".equals(args[i])){
				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(args[i])){
				new PutCodeSegment().execute();
				
			} else if ("-take".equals(args[i])){
				new PutCodeSegment().execute();
				new TakeCodeSegment("num");
				
			} else if ("-flip".equals(args[i])){
				new FlipCodeSegment("key").execute();
			} else if ("-peek".equals(args[i])){
				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);
				
			}
			
			
		}
		 
	}

}