本文整理了Java中org.elasticsearch.cluster.metadata.MappingMetaData.hasParentField()
方法的一些代码示例,展示了MappingMetaData.hasParentField()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MappingMetaData.hasParentField()
方法的具体详情如下:
包路径:org.elasticsearch.cluster.metadata.MappingMetaData
类名称:MappingMetaData
方法名:hasParentField
暂无
代码示例来源:origin: org.elasticsearch/elasticsearch
if (parent != null && !mappingMd.hasParentField()) {
throw new IllegalArgumentException("can't specify parent if no parent field has been configured");
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(type());
source().writeTo(out);
// routing
out.writeBoolean(routing().required());
if (out.getVersion().before(Version.V_6_0_0_alpha1)) {
// timestamp
out.writeBoolean(false); // enabled
out.writeString(DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.pattern());
out.writeOptionalString("now"); // 5.x default
out.writeOptionalBoolean(null);
}
out.writeBoolean(hasParentField());
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
public void process(Version indexCreatedVersion, @Nullable MappingMetaData mappingMd, String concreteIndex) {
if (mappingMd != null) {
// might as well check for routing here
if (mappingMd.routing().required() && routing == null) {
throw new RoutingMissingException(concreteIndex, type, id);
}
if (parent != null && !mappingMd.hasParentField()) {
throw new IllegalArgumentException("can't specify parent if no parent field has been configured");
}
} else {
if (parent != null) {
throw new IllegalArgumentException("can't specify parent if no parent field has been configured");
}
}
if ("".equals(id)) {
throw new IllegalArgumentException("if _id is specified it must not be empty");
}
// generate id if not already provided
if (id == null) {
assert autoGeneratedTimestamp == -1 : "timestamp has already been generated!";
autoGeneratedTimestamp = Math.max(0, System.currentTimeMillis()); // extra paranoia
String uid;
if (indexCreatedVersion.onOrAfter(Version.V_6_0_0_beta1)) {
uid = UUIDs.base64UUID();
} else {
uid = UUIDs.legacyBase64UUID();
}
id(uid);
}
}
代码示例来源:origin: apache/servicemix-bundles
public void process(Version indexCreatedVersion, @Nullable MappingMetaData mappingMd, String concreteIndex) {
if (mappingMd != null) {
// might as well check for routing here
if (mappingMd.routing().required() && routing == null) {
throw new RoutingMissingException(concreteIndex, type, id);
}
if (parent != null && !mappingMd.hasParentField()) {
throw new IllegalArgumentException("can't specify parent if no parent field has been configured");
}
} else {
if (parent != null) {
throw new IllegalArgumentException("can't specify parent if no parent field has been configured");
}
}
if ("".equals(id)) {
throw new IllegalArgumentException("if _id is specified it must not be empty");
}
// generate id if not already provided
if (id == null) {
assert autoGeneratedTimestamp == -1 : "timestamp has already been generated!";
autoGeneratedTimestamp = Math.max(0, System.currentTimeMillis()); // extra paranoia
String uid;
if (indexCreatedVersion.onOrAfter(Version.V_6_0_0_beta1)) {
uid = UUIDs.base64UUID();
} else {
uid = UUIDs.legacyBase64UUID();
}
id(uid);
}
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
if (parent != null && !mappingMd.hasParentField()) {
throw new IllegalArgumentException("can't specify parent if no parent field has been configured");
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
if (mappingMetaData.hasParentField()) {
Map<String,Object> parentsProps = (Map<String,Object>)mappingMap.get(ParentFieldMapper.NAME);
String pkColumns = (String)parentsProps.get(ParentFieldMapper.CQL_PARENT_PK);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(type());
source().writeTo(out);
// routing
out.writeBoolean(routing().required());
if (out.getVersion().before(Version.V_6_0_0_alpha1)) {
// timestamp
out.writeBoolean(false); // enabled
out.writeString(DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.format());
out.writeOptionalString("now"); // 5.x default
out.writeOptionalBoolean(null);
}
out.writeBoolean(hasParentField());
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(type());
source().writeTo(out);
// routing
out.writeBoolean(routing().required());
if (out.getVersion().before(Version.V_6_0_0_alpha1)) {
// timestamp
out.writeBoolean(false); // enabled
out.writeString(DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.format());
out.writeOptionalString("now"); // 5.x default
out.writeOptionalBoolean(null);
}
out.writeBoolean(hasParentField());
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(type());
source().writeTo(out);
// routing
out.writeBoolean(routing().required());
// timestamp
out.writeBoolean(timestamp().enabled());
out.writeString(timestamp().format());
out.writeOptionalString(timestamp().defaultTimestamp());
out.writeOptionalBoolean(timestamp().ignoreMissing());
out.writeBoolean(hasParentField());
}
代码示例来源:origin: harbby/presto-connectors
if (parent != null && !mappingMd.hasParentField()) {
throw new IllegalArgumentException("Can't specify parent if no parent field has been configured");
代码示例来源:origin: harbby/presto-connectors
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(type());
source().writeTo(out);
// id
if (id().hasPath()) {
out.writeBoolean(true);
out.writeString(id().path());
} else {
out.writeBoolean(false);
}
// routing
out.writeBoolean(routing().required());
if (routing().hasPath()) {
out.writeBoolean(true);
out.writeString(routing().path());
} else {
out.writeBoolean(false);
}
// timestamp
out.writeBoolean(timestamp().enabled());
out.writeOptionalString(timestamp().path());
out.writeString(timestamp().format());
out.writeOptionalString(timestamp().defaultTimestamp());
out.writeOptionalBoolean(timestamp().ignoreMissing());
out.writeBoolean(hasParentField());
}
内容来源于网络,如有侵权,请联系作者删除!