- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.atlas.repository.impexp.ZipSource
类的一些代码示例,展示了ZipSource
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipSource
类的具体详情如下:
包路径:org.apache.atlas.repository.impexp.ZipSource
类名称:ZipSource
暂无
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test
public void improperInit_ReturnsNullCreationOrder() throws IOException, AtlasBaseException {
byte bytes[] = new byte[10];
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
ZipSource zs = new ZipSource(bais);
List<String> s = zs.getCreationOrder();
Assert.assertNull(s);
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Override
public AtlasEntityWithExtInfo getNextEntityWithExtInfo() {
try {
currentPosition++;
return getEntityWithExtInfo(this.iterator.next());
} catch (AtlasBaseException e) {
LOG.error("getNextEntityWithExtInfo", e);
return null;
}
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Override
public AtlasEntity next() {
AtlasEntityWithExtInfo entityWithExtInfo = getNextEntityWithExtInfo();
return entityWithExtInfo != null ? entityWithExtInfo.getEntity() : null;
}
代码示例来源:origin: apache/incubator-atlas
private void setStartPosition(AtlasImportRequest request, ZipSource source) throws AtlasBaseException {
if(request.getStartGuid() != null) {
source.setPositionUsingEntityGuid(request.getStartGuid());
} else if(request.getStartPosition() != null) {
source.setPosition(Integer.parseInt(request.getStartPosition()));
}
}
代码示例来源:origin: org.apache.atlas/atlas-repository
public AtlasEntity.AtlasEntityWithExtInfo getEntityWithExtInfo(String guid) throws AtlasBaseException {
String s = getFromCache(guid);
AtlasEntity.AtlasEntityWithExtInfo entityWithExtInfo = convertFromJson(AtlasEntity.AtlasEntityWithExtInfo.class, s);
if (importTransform != null) {
entityWithExtInfo = importTransform.apply(entityWithExtInfo);
}
return entityWithExtInfo;
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test(dataProvider = "zipFileStocks")
public void iteratorBehavor_WorksAsExpected(ZipSource zipSource) throws IOException, AtlasBaseException {
Assert.assertTrue(zipSource.hasNext());
List<String> creationOrder = zipSource.getCreationOrder();
for (int i = 0; i < creationOrder.size(); i++) {
AtlasEntity e = zipSource.next();
assertNotNull(e);
assertEquals(e.getGuid(), creationOrder.get(i));
}
assertFalse(zipSource.hasNext());
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test(dataProvider = "sales")
public void iteratorSetPositionBehavor(ZipSource zipSource) throws IOException, AtlasBaseException {
Assert.assertTrue(zipSource.hasNext());
List<String> creationOrder = zipSource.getCreationOrder();
int moveToPosition_2 = 2;
zipSource.setPosition(moveToPosition_2);
assertEquals(zipSource.getPosition(), moveToPosition_2);
assertTrue(zipSource.getPosition() < creationOrder.size());
assertTrue(zipSource.hasNext());
for (int i = 1; i < 4; i++) {
zipSource.next();
assertEquals(zipSource.getPosition(), moveToPosition_2 + i);
}
assertTrue(zipSource.hasNext());
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@DataProvider(name = "zipFileStocksFloat")
public static Object[][] getDataFromZipFileWithLongFloats() throws IOException {
FileInputStream fs = ZipFileResourceTestUtils.getFileInputStream("stocks-float.zip");
return new Object[][] {{ new ZipSource(fs) }};
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test(dataProvider = "zipFileStocks")
public void applyTransformation(ZipSource zipSource) throws IOException, AtlasBaseException {
ImportTransforms transforms = getTransformForHiveDB();
zipSource.setImportTransform(transforms);
Assert.assertTrue(zipSource.hasNext());
List<String> creationOrder = zipSource.getCreationOrder();
for (int i = 0; i < creationOrder.size(); i++) {
AtlasEntity e = zipSource.next();
if(e.getTypeName().equals("hive_db")) {
Object o = e.getAttribute("qualifiedName");
String s = (String) o;
assertNotNull(e);
assertTrue(s.contains("@cl2"));
break;
}
}
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test
public void requestingEntityNotFound_NoData() throws AtlasBaseException, IOException {
String requestingIP = "1.0.0.0";
String hostName = "root";
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipSink zipSink = new ZipSink(baos);
AtlasExportResult result = exportService.run(
zipSink, getRequestForFullFetch(), "admin", hostName, requestingIP);
Assert.assertNull(result.getData());
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
ZipSource zipSource = new ZipSource(bais);
assertNotNull(exportService);
assertNotNull(zipSource.getCreationOrder());
Assert.assertFalse(zipSource.hasNext());
}
代码示例来源:origin: apache/incubator-atlas
processTypes(source.getTypesDef(), result);
setStartPosition(request, source);
processEntities(source, result);
source.close();
LOG.info("<== import(user={}, from={}): status={}", userName, requestingIP, result.getOperationStatus());
ZipSource source = new ZipSource(new ByteArrayInputStream(FileUtils.readFileToByteArray(file)), ImportTransforms.fromJson(transforms));
代码示例来源:origin: org.apache.atlas/atlas-repository
public AtlasImportResult run(ZipSource source, AtlasImportRequest request, String userName,
String hostName, String requestingIP) throws AtlasBaseException {
if (request == null) {
request = new AtlasImportRequest();
}
AtlasImportResult result = new AtlasImportResult(request, userName, requestingIP, hostName, System.currentTimeMillis());
try {
LOG.info("==> import(user={}, from={})", userName, requestingIP);
String transforms = MapUtils.isNotEmpty(request.getOptions()) ? request.getOptions().get(AtlasImportRequest.TRANSFORMS_KEY) : null;
source.setImportTransform(ImportTransforms.fromJson(transforms));
startTimestamp = System.currentTimeMillis();
processTypes(source.getTypesDef(), result);
setStartPosition(request, source);
processEntities(source, result);
result.setOperationStatus(AtlasImportResult.OperationStatus.SUCCESS);
} catch (AtlasBaseException excp) {
LOG.error("import(user={}, from={}): failed", userName, requestingIP, excp);
throw excp;
} catch (Exception excp) {
LOG.error("import(user={}, from={}): failed", userName, requestingIP, excp);
throw new AtlasBaseException(excp);
} finally {
source.close();
LOG.info("<== import(user={}, from={}): status={}", userName, requestingIP, result.getOperationStatus());
}
return result;
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test(dataProvider = "zipFileStocks")
public void examineContents_BehavesAsExpected(ZipSource zipSource) throws IOException, AtlasBaseException {
List<String> creationOrder = zipSource.getCreationOrder();
assertNotNull(creationOrder);
assertEquals(creationOrder.size(), 4);
AtlasTypesDef typesDef = zipSource.getTypesDef();
assertNotNull(typesDef);
assertEquals(typesDef.getEntityDefs().size(), 6);
useCreationOrderToFetchEntitiesWithExtInfo(zipSource, creationOrder);
useCreationOrderToFetchEntities(zipSource, creationOrder);
attemptToFetchNonExistentGuid_ReturnsNull(zipSource, "non-existent-guid");
verifyGuidRemovalOnImportComplete(zipSource, creationOrder.get(0));
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test(dataProvider = "zipFileStocksFloat")
public void attemptToSerializeLongFloats(ZipSource zipSource) throws IOException, AtlasBaseException {
Assert.assertTrue(zipSource.hasNext());
assertTrue(zipSource.hasNext());
assertTrue(zipSource.hasNext());
AtlasEntity.AtlasEntityWithExtInfo e = zipSource.getNextEntityWithExtInfo();
assertNotNull(e);
assertTrue(e.getEntity().getClassifications().size() > 0);
assertNotNull(e.getEntity().getClassifications().get(0).getAttribute("fv"));
assertEquals(e.getEntity().getClassifications().get(0).getAttribute("fv").toString(), "3.4028235E+38");
assertTrue(zipSource.hasNext());
}
代码示例来源:origin: org.apache.atlas/atlas-repository
@Test
public void requestingExportOfNonExistentEntity_ReturnsFailure() throws Exception {
AtlasExportRequest request = getRequestForEmployee();
tamperEmployeeRequest(request);
ZipSource zipSource = runExportWithParameters(request);
assertNotNull(zipSource.getCreationOrder());
assertEquals(zipSource.getCreationOrder().size(), 0);
assertEquals(AtlasExportResult.OperationStatus.FAIL, zipSource.getExportResult().getOperationStatus());
}
代码示例来源:origin: apache/incubator-atlas
@Override
public void reset() {
try {
getCreationOrder();
this.iterator = this.creationOrder.iterator();
} catch (AtlasBaseException e) {
LOG.error("reset", e);
}
}
代码示例来源:origin: apache/incubator-atlas
@Override
public void setPositionUsingEntityGuid(String guid) {
if(StringUtils.isBlank(guid)) {
return;
}
int index = creationOrder.indexOf(guid);
if (index == -1) {
return;
}
setPosition(index);
}
代码示例来源:origin: org.apache.atlas/atlas-repository
private void verifyTypeDefs(ZipSource zipSource) throws AtlasBaseException {
assertEquals(zipSource.getTypesDef().getEnumDefs().size(), 1);
assertEquals(zipSource.getTypesDef().getClassificationDefs().size(), 0);
assertEquals(zipSource.getTypesDef().getStructDefs().size(), 1);
assertEquals(zipSource.getTypesDef().getEntityDefs().size(), 4);
}
}
代码示例来源:origin: apache/incubator-atlas
@Test(dataProvider = "zipFileStocks")
public void iteratorBehavor_WorksAsExpected(ZipSource zipSource) throws IOException, AtlasBaseException {
Assert.assertTrue(zipSource.hasNext());
List<String> creationOrder = zipSource.getCreationOrder();
for (int i = 0; i < creationOrder.size(); i++) {
AtlasEntity e = zipSource.next();
assertNotNull(e);
assertEquals(e.getGuid(), creationOrder.get(i));
}
assertFalse(zipSource.hasNext());
}
代码示例来源:origin: apache/incubator-atlas
@Test(dataProvider = "sales")
public void iteratorSetPositionBehavor(ZipSource zipSource) throws IOException, AtlasBaseException {
Assert.assertTrue(zipSource.hasNext());
List<String> creationOrder = zipSource.getCreationOrder();
int moveToPosition_2 = 2;
zipSource.setPosition(moveToPosition_2);
assertEquals(zipSource.getPosition(), moveToPosition_2);
assertTrue(zipSource.getPosition() < creationOrder.size());
assertTrue(zipSource.hasNext());
for (int i = 1; i < 4; i++) {
zipSource.next();
assertEquals(zipSource.getPosition(), moveToPosition_2 + i);
}
assertTrue(zipSource.hasNext());
}
我正在尝试在 Ubuntu 上以独立方式运行 Apache Atlas - 这意味着无需设置 Solr 和/或 HBase。 我所做的(根据文档: http://atlas.apache.org/0.
我对 mongodb 和 atlas 还很陌生,对以下警报感到困惑 Query Targeting: Scanned Objects / Returned has gone above 1000 我希
在 Cloud Mongo (Mongo Atlas) 免费层上,它有 3 个服务器成员。如何从 Mongo shell 连接到 Secondary 主机?他们的例子只展示了如何连接到 Primary
我正在学习 Atlas 并试图找到一种从 RDBMS(如(Sql Server 或 Postgre Sql))导入元数据的方法。 有人可以提供引用或步骤吗? 我在 docker 中使用 Atlas 并
现在我无法解决依赖性,怎么了? 公司会更改名称吗?但是,我在他们的网站上看到它,但没有“com.layer.atlas:layer-atlas”,但是我的应用程序包含此依赖项,谁能告诉我原因? 最佳答
我的目标是创建一个索引 + 搜索管道,因此我可以通过搜索“reprod”找到以下文档: { name: "can you find this and reproduce?" } 我有什么: 我正在使用
我的目标是创建一个索引 + 搜索管道,因此我可以通过搜索“reprod”找到以下文档: { name: "can you find this and reproduce?" } 我有什么: 我正在使用
在调查用于物联网数据存储的兼容数据库时,我查看了 MongoDB,发现定价有点令人困惑。 只是想知道 MongoDB Atlas 之间有什么区别?和 MongoDB Atlas for AWS因为他们
当我点击删除按钮时,它显示: 错误信息:“项目名称”有正在运行的 Atlas 集群。在删除项目之前,需要终止所有 Atlas 集群。如下图所示: 最佳答案 这真的很容易。您只需要在删除项目之前终止集群
我正在评估从 Google Kubernetes Engine 迁移到 Google Cloud Run,以提高我们公司内部的成本和资源效率。我还在将我们的工作流从单一的 PHP 和 Ruby 应用程
我使用以下过程将本地数据库迁移到图集 使用 mongoexport --db bla 将数据库集合一一导出 --collection usersettings --jsonArray --out ~/
Atlassian plugin SDK用于为 Atlassian 产品创建插件。 该套件包括两个程序,atlas-run和 atlas-run-standalone似乎执行相同的任务:在其中一个产品
如果结果是40,那么将结果限制为10也会将MATCHED_COUNT更改为10,而实际上它应该是40。关于atlas搜索的Mongoose文档非常有限,不包括这样的情况。如果你遇到过类似的问题,如果你
在最近的一次培训中,我了解了使用$earch操作符的好处。我想修改我的$Match查询以使用$Search。但是,我找不到与$in运算符等效的运算符。。当字段需要匹配单个对象ID时,这是没有问题的,我
我们如何以最短的停机时间将数据从 MongoDB ATLAS 迁移到本地?我们可以使用 mongomirror 从本地迁移到 ATLAS。是否有任何类似的工具可以将日期从 MongoDB ATLAS
我在尝试将容器化的应用程序部署到GKE时遇到问题。它无法访问我的MongoDB Atlas集群。在本地运行Docker容器不会产生任何问题,并且运行良好。我绝不是Docker或Kubernetes的专
在我尝试将我的 Assets ( Sprite 表)放入 iOS 框架之前,一切都运行良好。我正在使用 Swift 3.0 为了减轻我的 Xcode 项目的负担,我决定将我的 Assets :Text
所以我有一个 vapor\fluent 应用程序可以很好地与本地 mongo 实例一起工作,这是当前的 mongo.json: { "database" : "vapor", "por
我正在尝试关注this答案是从云函数连接到 mongodb atlas 数据库。 我使用上面答案中的代码: import { MongoClient } from 'mongodb' const ur
我一次只删除 Mongodb 云数据库(Atlas)中的一条记录。我有 60 条记录要删除,这很痛苦。我没有看到一次删除多条记录的明显方法。有没有简单的方法可以做到这一点? 最佳答案 您实际上无法在
我是一名优秀的程序员,十分优秀!