本文整理了Java中org.apache.gobblin.source.workunit.Extract.getNamespace()
方法的一些代码示例,展示了Extract.getNamespace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Extract.getNamespace()
方法的具体详情如下:
包路径:org.apache.gobblin.source.workunit.Extract
类名称:Extract
方法名:getNamespace
[英]Get the dot-separated namespace of the table.
[中]
代码示例来源:origin: apache/incubator-gobblin
@Override
public int hashCode() {
return (this.getNamespace() + this.getTable() + this.getExtractId()).hashCode();
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public boolean equals(Object object) {
if (!(object instanceof Extract)) {
return false;
}
Extract other = (Extract) object;
return super.equals(other) && this.getNamespace().equals(other.getNamespace())
&& this.getTable().equals(other.getTable()) && this.getExtractId().equals(other.getExtractId());
}
代码示例来源:origin: apache/incubator-gobblin
/**
* Get the writer output file path corresponding to this {@link Extract}.
*
* @return writer output file path corresponding to this {@link Extract}
* @deprecated As {@code this.getIsFull} is deprecated.
*/
@Deprecated
public String getOutputFilePath() {
return this.getNamespace().replaceAll("\\.", "/") + "/" + this.getTable() + "/" + this.getExtractId() + "_"
+ (this.getIsFull() ? "full" : "append");
}
代码示例来源:origin: apache/incubator-gobblin
if (previousExtract.getNamespace().equals(namespace) && previousExtract.getTable().equals(table)) {
this.previousTableState.addAll(pre);
代码示例来源:origin: apache/incubator-gobblin
@Test
public void schemaWithRecordOfEnum()
throws Exception {
String testName = "schemaWithRecordOfEnum";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
RecordConverter converter = new RecordConverter(new JsonSchema(schema), state,
buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
代码示例来源:origin: apache/incubator-gobblin
@Test
public void schemaWithRecordOfArray()
throws Exception {
String testName = "schemaWithRecordOfArray";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
RecordConverter converter = new RecordConverter(new JsonSchema(schema), state,
buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
代码示例来源:origin: apache/incubator-gobblin
@Test
public void schemaWithRecordIsNullable()
throws Exception {
String testName = "schemaWithRecordIsNullable";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonArray expected = getExpectedSchema(testName).getAsJsonArray();
RecordConverter converter = new RecordConverter(new JsonSchema(schema), state,
buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
代码示例来源:origin: apache/incubator-gobblin
@Test(expectedExceptions = IllegalStateException.class)
public void schemaWithMapValuesAsJsonArray()
throws Exception {
String testName = "schemaWithMapValuesAsJsonArray";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
new RecordConverter(new JsonSchema(schema), state, buildNamespace(state.getExtract().getNamespace(), "something"));
}
代码示例来源:origin: apache/incubator-gobblin
@Test
public void schemaWithRecordOfMap()
throws Exception {
String testName = "schemaWithRecordOfMap";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
RecordConverter converter = new RecordConverter(new JsonSchema(schema), state,
buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
代码示例来源:origin: apache/incubator-gobblin
@Test
public void schemaWithRecordOfRecord()
throws Exception {
String testName = "schemaWithRecordOfRecord";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
RecordConverter converter = new RecordConverter(new JsonSchema(schema), state,
buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
代码示例来源:origin: apache/incubator-gobblin
@Test
public void schemaWithRecord()
throws DataConversionException, SchemaConversionException, UnsupportedDateTypeException {
String testName = "schemaWithRecord";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
JsonSchema jsonSchema = new JsonSchema(schema);
jsonSchema.setColumnName("dummy1");
RecordConverter converter =
new RecordConverter(jsonSchema, state, buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
}
代码示例来源:origin: apache/incubator-gobblin
@Test(expectedExceptions = UnsupportedOperationException.class)
public void schemaWithMapValuesAsJsonNull()
throws Exception {
String testName = "schemaWithMapValuesAsJsonNull";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
new RecordConverter(new JsonSchema(schema), state, buildNamespace(state.getExtract().getNamespace(), "something"));
}
代码示例来源:origin: apache/incubator-gobblin
@Test
public void schemaWithRecordOfRecordCheckNamespace()
throws Exception {
String testName = "schemaWithRecordOfRecordCheckNamespace";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
RecordConverter converter =
new RecordConverter(new JsonSchema(schema), state, buildNamespace(state.getExtract().getNamespace(), "person"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
Assert.assertEquals(converter.schema().getField("someperson").schema().getNamespace(), "namespace.person.myrecord");
Assert.assertEquals(converter.schema().getNamespace(), "namespace.person");
}
代码示例来源:origin: apache/incubator-gobblin
@Test
public void schemaWithRecordOfEnumCheckNamespace()
throws Exception {
String testName = "schemaWithRecordOfEnumCheckNamespace";
JsonObject schema = getSchemaData(testName).getAsJsonObject();
JsonObject expected = getExpectedSchema(testName).getAsJsonObject();
RecordConverter converter = new RecordConverter(new JsonSchema(schema), state,
buildNamespace(state.getExtract().getNamespace(), "something"));
Assert.assertEquals(avroSchemaToJsonElement(converter), expected);
Assert.assertEquals(converter.schema().getField("someperson").schema().getNamespace(),
"namespace.something.myrecord");
Assert.assertEquals(converter.schema().getNamespace(), "namespace.something");
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public Schema convertSchema(JsonArray schema, WorkUnitState workUnit)
throws SchemaConversionException {
try {
JsonSchema jsonSchema = new JsonSchema(schema);
jsonSchema.setColumnName(workUnit.getExtract().getTable());
recordConverter = new RecordConverter(jsonSchema, workUnit, workUnit.getExtract().getNamespace());
} catch (UnsupportedDateTypeException e) {
throw new SchemaConversionException(e);
}
Schema recordSchema = recordConverter.schema();
if (workUnit
.getPropAsBoolean(CONVERTER_AVRO_NULLIFY_FIELDS_ENABLED, DEFAULT_CONVERTER_AVRO_NULLIFY_FIELDS_ENABLED)) {
return this.generateSchemaWithNullifiedField(workUnit, recordSchema);
}
return recordSchema;
}
代码示例来源:origin: apache/incubator-gobblin
table.setNamespace(extract.getNamespace());
table.setName(extract.getTable());
if (extract.hasType()) {
代码示例来源:origin: org.apache.gobblin/gobblin-api
@Override
public boolean equals(Object object) {
if (!(object instanceof Extract)) {
return false;
}
Extract other = (Extract) object;
return super.equals(other) && this.getNamespace().equals(other.getNamespace())
&& this.getTable().equals(other.getTable()) && this.getExtractId().equals(other.getExtractId());
}
代码示例来源:origin: org.apache.gobblin/gobblin-api
@Override
public int hashCode() {
return (this.getNamespace() + this.getTable() + this.getExtractId()).hashCode();
}
代码示例来源:origin: org.apache.gobblin/gobblin-api
/**
* Get the writer output file path corresponding to this {@link Extract}.
*
* @return writer output file path corresponding to this {@link Extract}
* @deprecated As {@code this.getIsFull} is deprecated.
*/
@Deprecated
public String getOutputFilePath() {
return this.getNamespace().replaceAll("\\.", "/") + "/" + this.getTable() + "/" + this.getExtractId() + "_"
+ (this.getIsFull() ? "full" : "append");
}
代码示例来源:origin: org.apache.gobblin/gobblin-core
@Override
public Schema convertSchema(JsonArray schema, WorkUnitState workUnit)
throws SchemaConversionException {
try {
JsonSchema jsonSchema = new JsonSchema(schema);
jsonSchema.setColumnName(workUnit.getExtract().getTable());
recordConverter = new RecordConverter(jsonSchema, workUnit, workUnit.getExtract().getNamespace());
} catch (UnsupportedDateTypeException e) {
throw new SchemaConversionException(e);
}
Schema recordSchema = recordConverter.schema();
if (workUnit
.getPropAsBoolean(CONVERTER_AVRO_NULLIFY_FIELDS_ENABLED, DEFAULT_CONVERTER_AVRO_NULLIFY_FIELDS_ENABLED)) {
return this.generateSchemaWithNullifiedField(workUnit, recordSchema);
}
return recordSchema;
}
内容来源于网络,如有侵权,请联系作者删除!