本文整理了Java中org.apache.atlas.repository.impexp.ZipExportFileNames
类的一些代码示例,展示了ZipExportFileNames
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipExportFileNames
类的具体详情如下:
包路径:org.apache.atlas.repository.impexp.ZipExportFileNames
类名称:ZipExportFileNames
暂无
代码示例来源:origin: apache/incubator-atlas
public AtlasExportResult getExportResult() throws AtlasBaseException {
final String fileName = ZipExportFileNames.ATLAS_EXPORT_INFO_NAME.toString();
String s = getFromCache(fileName);
return convertFromJson(AtlasExportResult.class, s);
}
代码示例来源:origin: apache/incubator-atlas
public AtlasTypesDef getTypesDef() throws AtlasBaseException {
final String fileName = ZipExportFileNames.ATLAS_TYPESDEF_NAME.toString();
String s = (String) getFromCache(fileName);
return convertFromJson(AtlasTypesDef.class, s);
}
代码示例来源:origin: apache/incubator-atlas
private void setCreationOrder() {
String fileName = ZipExportFileNames.ATLAS_EXPORT_ORDER_NAME.toString();
try {
String s = getFromCache(fileName);
this.creationOrder = convertFromJson(List.class, s);
this.iterator = this.creationOrder.iterator();
} catch (AtlasBaseException e) {
LOG.error(String.format("Error retrieving '%s' from zip.", fileName), e);
}
}
代码示例来源:origin: apache/incubator-atlas
private void updateGuidZipEntryMap() throws IOException {
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
ZipEntry zipEntry = zipInputStream.getNextEntry();
while (zipEntry != null) {
String entryName = zipEntry.getName().replace(".json", "");
if (guidEntityJsonMap.containsKey(entryName)) continue;
byte[] buf = new byte[1024];
int n = 0;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
while ((n = zipInputStream.read(buf, 0, 1024)) > -1) {
bos.write(buf, 0, n);
}
guidEntityJsonMap.put(entryName, bos.toString());
zipEntry = zipInputStream.getNextEntry();
}
zipInputStream.close();
}
代码示例来源:origin: org.apache.atlas/atlas-repository
private void saveToZip(ZipExportFileNames fileName, String jsonData) throws AtlasBaseException {
saveToZip(fileName.toString(), jsonData);
}
代码示例来源:origin: org.apache.atlas/atlas-repository
private void setCreationOrder() {
String fileName = ZipExportFileNames.ATLAS_EXPORT_ORDER_NAME.toString();
try {
String s = getFromCache(fileName);
this.creationOrder = convertFromJson(List.class, s);
this.iterator = this.creationOrder.iterator();
} catch (AtlasBaseException e) {
LOG.error(String.format("Error retrieving '%s' from zip.", fileName), e);
}
}
代码示例来源:origin: org.apache.atlas/atlas-repository
public AtlasTypesDef getTypesDef() throws AtlasBaseException {
final String fileName = ZipExportFileNames.ATLAS_TYPESDEF_NAME.toString();
String s = (String) getFromCache(fileName);
return convertFromJson(AtlasTypesDef.class, s);
}
代码示例来源:origin: apache/incubator-atlas
private void saveToZip(String fileName, String jsonData) throws AtlasBaseException {
try {
addToZipStream(fileName.toString() + ".json", jsonData);
} catch (IOException e) {
throw new AtlasBaseException(String.format("Error writing file %s.", fileName), e);
}
}
代码示例来源:origin: org.apache.atlas/atlas-repository
public AtlasExportResult getExportResult() throws AtlasBaseException {
final String fileName = ZipExportFileNames.ATLAS_EXPORT_INFO_NAME.toString();
String s = getFromCache(fileName);
return convertFromJson(AtlasExportResult.class, s);
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test
public void verifyExportOrderEntryName_verifies() throws AtlasBaseException, IOException {
ZipInputStream zis = getZipInputStreamForDefaultExportOrder();
ZipEntry ze = zis.getNextEntry();
assertEquals(ze.getName().replace(".json", ""), ZipExportFileNames.ATLAS_EXPORT_ORDER_NAME.toString());
}
代码示例来源:origin: apache/incubator-atlas
@Test
public void zipWithExactlyTwoEntries_ContentsVerified() throws AtlasBaseException, IOException {
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
useZipSinkToCreateEntries(byteOutputStream);
ByteArrayInputStream bis = new ByteArrayInputStream(byteOutputStream.toByteArray());
ZipInputStream zipStream = new ZipInputStream(bis);
ZipEntry entry = zipStream.getNextEntry();
assertEquals(getZipEntryAsStream(zipStream), "[\"a\",\"b\",\"c\",\"d\"]");
assertEquals(entry.getName().replace(".json", ""), ZipExportFileNames.ATLAS_EXPORT_ORDER_NAME.toString());
entry = zipStream.getNextEntry();
assertEquals(entry.getName().replace(".json", ""), ZipExportFileNames.ATLAS_EXPORT_INFO_NAME.toString());
assertTrue(compareJsonWithObject(getZipEntryAsStream(zipStream), defaultExportResult));
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test
public void zipWithExactlyTwoEntries_ContentsVerified() throws AtlasBaseException, IOException {
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
useZipSinkToCreateEntries(byteOutputStream);
ByteArrayInputStream bis = new ByteArrayInputStream(byteOutputStream.toByteArray());
ZipInputStream zipStream = new ZipInputStream(bis);
ZipEntry entry = zipStream.getNextEntry();
assertEquals(getZipEntryAsStream(zipStream), "[\"a\",\"b\",\"c\",\"d\"]");
assertEquals(entry.getName().replace(".json", ""), ZipExportFileNames.ATLAS_EXPORT_ORDER_NAME.toString());
entry = zipStream.getNextEntry();
assertEquals(entry.getName().replace(".json", ""), ZipExportFileNames.ATLAS_EXPORT_INFO_NAME.toString());
assertTrue(compareJsonWithObject(getZipEntryAsStream(zipStream), defaultExportResult));
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test
public void recordsDoesNotRecordEntityEntries() throws AtlasBaseException {
initZipSinkWithExportOrder();
assertNotNull(zipSink);
assertFalse(zipSink.hasEntity(ZipExportFileNames.ATLAS_EXPORT_ORDER_NAME.toString()));
}
内容来源于网络,如有侵权,请联系作者删除!