mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-27 09:11:08 -06:00
allow nested Template within thread
This commit is contained in:
parent
428ffe718f
commit
0ce2f6356f
@ -41,7 +41,7 @@ public class Template implements LongFunction<String> {
|
||||
private final static Logger logger = LogManager.getLogger(Template.class);
|
||||
private static final String EXPR_BEGIN = "[[";
|
||||
private static final String EXPR_END = "]]";
|
||||
private final static ThreadLocal<StringBuilder> sb = ThreadLocal.withInitial(StringBuilder::new);
|
||||
// private final static ThreadLocal<StringBuilder> sb = ThreadLocal.withInitial(StringBuilder::new);
|
||||
private final String rawTemplate;
|
||||
private LongUnaryOperator iterOp;
|
||||
private String[] literals;
|
||||
@ -138,7 +138,7 @@ public class Template implements LongFunction<String> {
|
||||
|
||||
@Override
|
||||
public String apply(long value) {
|
||||
StringBuilder buffer = sb.get();
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
buffer.setLength(0);
|
||||
buffer.append(literals[0]);
|
||||
if (literals.length > 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user