如何从kafka中的消息中识别主题名称.
String[] topics = { "test", "test1", "test2" };
for (String t : topics) {
topicMap.put(t, new Integer(3));
}
SparkConf conf = new SparkConf().setAppName("KafkaReceiver")
.set("spark.streaming.receiver.writeAheadLog.enable", "false")
.setMaster("local[4]")
.set("spark.cassandra.connection.host", "localhost");
;
final JavaSparkContext sc = new JavaSparkContext(conf);
JavaStreamingContext jssc = new JavaStreamingContext(sc, new Duration(
1000));
/* Receive Kafka streaming inputs */
JavaPairReceiverInputDStream<String, String> messages = KafkaUtils
.createStream(jssc, "localhost:2181", "test-group",
topicMap);
JavaDStream<MessageAndMetadata> data =
messages.map(new Function<Tuple2<String, String>, MessageAndMetadata>()
{
public MessageAndMetadata call(Tuple2<String, String> message)
{
System.out.println("message ="+message._2);
return null;
} …Run Code Online (Sandbox Code Playgroud) 我在添加自定义方面的文档时遇到问题(Alfresco 4.2e).它显示以下错误:
Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Type 'kb:referencable' is unknown!
Run Code Online (Sandbox Code Playgroud)
任何帮助将非常感激.
这些是我的文件:
sample.java
Map<String, String> props = new HashMap<String, String>();
props.put(PropertyIds.NAME, newDocName);
props.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,kb:referencable");
props.put("kb:documentRef", "My document");
String content = "sample=================" ;
byte[] buf = null;
try {
buf = content.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
ByteArrayInputStream input = new ByteArrayInputStream(buf);
ContentStream contentStream = session.getObjectFactory()
.createContentStream(newDocName, buf.length,
"text/plain; charset=UTF-8", input);
target.createDocument(props, contentStream, VersioningState.MAJOR);
Run Code Online (Sandbox Code Playgroud)
共享配置,custom.xml
<aspects>
<!-- Aspects that a user can see -->
<visible>
<aspect name="cm:generalclassifiable" /> …Run Code Online (Sandbox Code Playgroud) 如何在 couchdb 中编写通配符搜索?我想在 sql 中编写与“LIKE %”相同的查询。请帮助我。
{
"name":"arun",
"surname":"mr"
}
{
"name":"balu",
"surname":"tp"
}
Run Code Online (Sandbox Code Playgroud)
我需要列出所有以“a”开头的名称。
谢谢..
我想在post请求体中发送user:user .我正在使用改造 lib.请建议我.
我已经尝试过这样了
@POST(/login)
void login(@BODY String s,Callback<LoginResponse>)
Run Code Online (Sandbox Code Playgroud)
并称之为
login("user:user",Callback<LoginResponse>)
java ×2
alfresco ×1
apache-kafka ×1
apache-spark ×1
cassandra ×1
couchdb ×1
json ×1
retrofit ×1