是时候用 ES 拯救发际线啦

es5.0,java客户端关于ShieldPlugin

Elasticsearch | 作者 novia | 发布于2016年11月23日 | 阅读数:4863

Settings settings = Settings.builder().put("cluster.name", "xxx").put("client.transport.sniff",true).put("shield.user","xxx:xxx").build();
try {
client = new PreBuiltTransportClient(settings, ShieldPlugin.class)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("xxx"), 9300))
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("xxx"), 9300));
} catch (UnknownHostException e) {
e.printStackTrace();
}

这样获取客户端,报错如下:
Exception in thread "main" java.lang.VerifyError: class org.elasticsearch.shield.ShieldPlugin overrides final method onModule.(Lorg/elasticsearch/action/ActionModule;)V
看了下5.0的plugin,
/** @deprecated */
@Deprecated
public final void onModule(IndexModule indexModule) {
}

/** @deprecated */
@Deprecated
public final void onModule(SettingsModule settingsModule) {
}

/** @deprecated */
@Deprecated
public final void onModule(ScriptModule module) {
}

/** @deprecated */
@Deprecated
public final void onModule(AnalysisModule module) {
}

/** @deprecated */
@Deprecated
public final void onModule(ActionModule module) {
}

/** @deprecated */
@Deprecated
public final void onModule(SearchModule module) {
}
都已经是final,所以报错
这个有什么方法可以代替吗?
已邀请:

要回复问题请先登录注册