kafka-manager 2.0

This commit is contained in:
zengqiao
2020-09-28 15:46:34 +08:00
parent 28d985aaf1
commit c6e4b60424
1253 changed files with 82183 additions and 37179 deletions

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

View File

@@ -0,0 +1,47 @@
package com.xiaojukeji.kafka.manager.service;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
import org.junit.Test;
public class FutureTest {
@Test
public void test() throws InterruptedException, ExecutionException {
FutureTask<Integer> f1 = new FutureTask<Integer>(new Callable<Integer>() {
@Override
public Integer call() throws InterruptedException {
Thread.sleep(1000L);
return 1;
}
});
FutureTask<Integer> f2 = new FutureTask<Integer>(new Callable<Integer>() {
@Override
public Integer call() throws InterruptedException {
Thread.sleep(1000L);
return 2;
}
});
ExecutorService threadPool = Executors.newCachedThreadPool();
long ct = System.currentTimeMillis();
threadPool.submit(f1);
threadPool.submit(f2);
threadPool.shutdown();
System.out.println(f1.get() + " : " + f2.get() + " use:"
+ (System.currentTimeMillis() - ct));
}
}

View File

@@ -0,0 +1,13 @@
package com.xiaojukeji.kafka.manager.service.utils;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* Created by arthur on 2017/5/31.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:biz-test.xml" })
public class SpringTestBase {
}