Github user jackylk commented on a diff in the pull request:
https://github.com/apache/incubator-carbondata/pull/605#discussion_r102360297
--- Diff:
core/src/main/java/org/apache/carbondata/core/dictionary/client/DictionaryClientHandler.java
---
@@ -77,20 +79,13 @@ public void exceptionCaught(ChannelHandlerContext ctx,
ExceptionEvent e) throws
*/
public DictionaryKey getDictionary(DictionaryKey key) {
DictionaryKey dictionaryKey;
- BlockingQueue<DictionaryKey> dictKeyQueue = null;
try {
- synchronized (lock) {
- dictKeyQueue = dictKeyQueueMap.get(key.getThreadNo());
- if (dictKeyQueue == null) {
- dictKeyQueue = new LinkedBlockingQueue<DictionaryKey>();
- dictKeyQueueMap.put(key.getThreadNo(), dictKeyQueue);
- }
- }
- byte[] serialize = KryoRegister.serialize(key);
- ctx.getChannel().write(serialize);
+ ByteBuf buffer = ctx.alloc().buffer();
+ key.writeData(buffer);
+ ctx.writeAndFlush(buffer);
--- End diff --
better to handle failure case by `addListener`
```
ChannelFuture f = channel.writeAndFlush(request);
f.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (future.isSuccess()) {
LOGGER.info("sent success");
} else {
LOGGER.info("sent failed");
}
}
});
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---