My Code as below:
public static boolean createTopic(String topicname, String zkUrl, int sessionTimeout, int connectTimeout, int partitions, int replicationFactor){
boolean result = false;
ZkUtils zkUtil = ZkUtils.apply(zkUrl, connectTimeout, sessionTimeout, JaasUtils.isZkSecurityEnabled());
RackAwareMode rackAwareMode = RackAwareMode.Enforced;
if(AdminUtils.topicExists(zkUtil, topicname)){
return true;
}
else{
AdminUtils.createTopic(zkUtil,topicname,partitions,replicationFactor, null, null);
}
return result;
}
and the Scala code as below
object RackAwareMode {
case object Disabled extends RackAwareMode
case object Enforced extends RackAwareMode
case object Safe extends RackAwareMode
}
sealed trait RackAwareMode
The Error arised at the line below: RackAwareMode rackAwareMode = RackAwareMode.Enforced;
Any ideas for me?