mirror of
https://github.com/Febbweiss/log-generator.git
synced 2026-03-04 22:25:40 +00:00
Fix formatting
This commit is contained in:
@@ -4,10 +4,10 @@ import com.beust.jcommander.Parameter;
|
|||||||
|
|
||||||
public class InputParameters {
|
public class InputParameters {
|
||||||
|
|
||||||
@Parameter(names = { "-log", "-n" }, description = "Number of logs to generate")
|
@Parameter(names = {"-logs", "-n"}, description = "Number of logs to generate")
|
||||||
public Long logs = 10L;
|
public Long logs = 10L;
|
||||||
|
|
||||||
@Parameter(names = { "-threads", "-t" }, description = "Number of threads to use")
|
@Parameter(names = {"-threads", "-t"}, description = "Number of threads to use")
|
||||||
public Integer threads = 2;
|
public Integer threads = 2;
|
||||||
|
|
||||||
@Parameter(names = "--help", help = true)
|
@Parameter(names = "--help", help = true)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class LogExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public LogExecutor addAll(Iterable<Callable<Long>> tasks) {
|
public LogExecutor addAll(Iterable<Callable<Long>> tasks) {
|
||||||
for(Callable<Long> task : tasks) {
|
for (Callable<Long> task : tasks) {
|
||||||
executor.submit(task);
|
executor.submit(task);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ public class SearchTask implements Callable<Long> {
|
|||||||
private static final Logger log = LoggerFactory.getLogger(SearchTask.class);
|
private static final Logger log = LoggerFactory.getLogger(SearchTask.class);
|
||||||
private final long id;
|
private final long id;
|
||||||
|
|
||||||
public SearchTask(final long id) {
|
public SearchTask(final long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long call() throws Exception {
|
public Long call() throws Exception {
|
||||||
log.info("{} - {}", id, Utils.getRandomIP());
|
log.info("{} - {}", id, Utils.getRandomIP());
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ public class SellTask implements Callable<Long> {
|
|||||||
private static final Logger log = LoggerFactory.getLogger(SellTask.class);
|
private static final Logger log = LoggerFactory.getLogger(SellTask.class);
|
||||||
private final long id;
|
private final long id;
|
||||||
|
|
||||||
public SellTask(final long id) {
|
public SellTask(final long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long call() throws Exception {
|
public Long call() throws Exception {
|
||||||
log.info("{} - {}", id, Utils.getRandomIP());
|
log.info("{} - {}", id, Utils.getRandomIP());
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user