我正在尝试使用数组注册一个类(使用Kryo激活的Spark Java),日志显示一条明确的消息:
Class is not registered: org.apache.spark.sql.execution.datasources.InMemoryFileIndex$SerializableBlockLocation[]
Run Code Online (Sandbox Code Playgroud)
我写了几个组合,但这些组合不起作用:
kryo.register(Class.forName("org.apache.spark.sql.execution.datasources.InMemoryFileIndex$SerializableBlockLocation[]")); // ERROR
kryo.register(Class.forName("org.apache.spark.sql.execution.datasources.InMemoryFileIndex$SerializableBlockLocation[].class")); // ERROR
kryo.register(Class.forName("org.apache.spark.sql.execution.datasources.InMemoryFileIndex$SerializableBlockLocation$Array")); // ERROR
kryo.register(Class.forName("[org.apache.spark.sql.execution.datasources.InMemoryFileIndex$SerializableBlockLocation")); // ERROR
kryo.register(Class.forName("[Lorg.apache.spark.sql.execution.datasources.InMemoryFileIndex$SerializableBlockLocation")); // ERROR
kryo.register(Class.forName("Array[org.apache.spark.sql.execution.datasources.InMemoryFileIndex$SerializableBlockLocation]")); // ERROR
kryo.register(Class.forName("[[org.apache.spark.sql.execution.datasources.InMemoryFileIndex$SerializableBlockLocation")); // ERROR
Run Code Online (Sandbox Code Playgroud)
我也尝试编写注册类,Class.forName但Java无法解析符号InMemoryFileIndex$SerializableBlockLocation:
kryo.register(org.apache.spark.sql.execution.datasources.InMemoryFileIndex$SerializableBlockLocation[].class);
Run Code Online (Sandbox Code Playgroud)
所有其他类都在我的KryoRegister.class中工作.
当我停止副本集的节点并再次启动它们时,主节点进入"恢复"状态.
我创建了一个副本集,未经授权运行.为了使用授权,我添加了用户"db.createUser(...)",并在配置文件中启用了授权:
security:
authorization: "enabled"
Run Code Online (Sandbox Code Playgroud)
在停止副本集(甚至重新启动集群而不添加安全性参数)之前,rs.status()显示:
{
"set" : "REPLICASET",
"date" : ISODate("2016-09-08T09:57:50.335Z"),
"myState" : 1,
"term" : NumberLong(7),
"heartbeatIntervalMillis" : NumberLong(2000),
"members" : [
{
"_id" : 0,
"name" : "192.168.1.167:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 301,
"optime" : {
"ts" : Timestamp(1473328390, 2),
"t" : NumberLong(7)
},
"optimeDate" : ISODate("2016-09-08T09:53:10Z"),
"electionTime" : Timestamp(1473328390, 1),
"electionDate" : ISODate("2016-09-08T09:53:10Z"),
"configVersion" : 1,
"self" : true
},
{
"_id" : 1,
"name" : "192.168.1.168:27017",
"health" …Run Code Online (Sandbox Code Playgroud) 我正在从其他群集中导入工作流,以避免出现冲突:
通过这种方式,它可以顺畅地导入新的一个工作流程以及具有name + timestamp的许多副本。我如何避免这个问题?
我正在尝试在 amcharts 中添加一个操作,例如:
function myfunc(name){
alert("hi "+name);
}
var tooltipDetail='<div class="detail" name="{name}" onclick="myfunc({name});">detail {name}</div>'
series1.columns.template.tooltipHTML = tooltipDetail;
Run Code Online (Sandbox Code Playgroud)
当我用 'alert(1)' 替换 'myfunc()' 时,它会启动一个警报,但在代码中定义的 myfunc 会在控制台 'Uncaught ReferenceError: myfunc is not defined' 中启动一个错误。为什么?我该如何解决这个问题?
我的意图是使用 jquery 创建一个更详细的函数,例如:
$('.detail').click(function(){
var name=this.attr("name");
$("#selected").html(name);
});
Run Code Online (Sandbox Code Playgroud)
但它不起作用,然后我简化了代码...我检查了 $('.detail').html() 如果工具提示尚未显示,则不可用,所以我认为它是在启动工具提示时构建的。
我还尝试在工具提示中包含该功能,例如:
var tooltipDetail='<script>function hi({name}){alert("hi"+name);}</script><div class="detail" name="{name}" onclick="hi({name});">detail {name}</div>'
Run Code Online (Sandbox Code Playgroud)
它导致同样的问题,'hi' 未定义。
有什么推荐吗?谢谢
为什么第二次转型失败了?
\ndf\n .withColumn("schemaDetected", schema_of_json(lit("""{"Zipcode":704,"ZipCodeType":"STANDARD","City":"PARC PARQUE","State":"PR"}""")))\n .show(false)\n//shows: struct<City:string,State:string,ZipCodeType:string,Zipcode:bigint>\n\ndf\n .withColumn("literal", lit("""{"Zipcode":704,"ZipCodeType":"STANDARD","City":"PARC PARQUE","State":"PR"}"""))\n .withColumn("schemaDetected", schema_of_json(col("literal")))\n .show(false)\n// it fails:\n// cannot resolve 'schema_of_json(`literal`)' due to data type mismatch: The input json should be a string literal and not null; however, got `literal`.;;\nRun Code Online (Sandbox Code Playgroud)\n我需要获取一个列模式,但它只接受方法内部包含的“lit”,当我添加列时它会失败。\xc2\xbf为什么?
\n