org.apache.gobblin.util.guid.Guid.fromStrings()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.apache.gobblin.util.guid.Guid.fromStrings()方法的一些代码示例,展示了Guid.fromStrings()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Guid.fromStrings()方法的具体详情如下:
包路径:org.apache.gobblin.util.guid.Guid
类名称:Guid
方法名:fromStrings

Guid.fromStrings介绍

[英]Generate a Guid for an array of Strings.
[中]为字符串数组生成Guid。

代码示例

代码示例来源:origin: apache/incubator-gobblin

@Override
public Guid guid() throws IOException {
 return Guid.fromStrings(toString());
}

代码示例来源:origin: apache/incubator-gobblin

@Override
 public String getStateStoreNameFromDatasetUrn(String datasetUrn)
   throws IOException {
  if (!this.sanitizedNameToDatasetURNMap.inverse().containsKey(datasetUrn)) {
   String guid = Guid.fromStrings(datasetUrn).toString();
   this.sanitizedNameToDatasetURNMap.put(guid, datasetUrn);
  }
  return this.sanitizedNameToDatasetURNMap.inverse().get(datasetUrn);
 }
}

代码示例来源:origin: apache/incubator-gobblin

/**
 * Generates a replicable guid to uniquely identify the origin of this {@link CopyableFile}.
 * @return a guid uniquely identifying the origin file.
 */
@Override
public Guid guid() throws IOException {
 StringBuilder uniqueString = new StringBuilder();
 uniqueString.append(getFileStatus().getModificationTime());
 uniqueString.append(getFileStatus().getLen());
 uniqueString.append(getFileStatus().getPath());
 return Guid.fromStrings(uniqueString.toString());
}

代码示例来源:origin: apache/incubator-gobblin

throws IOException {
for (String datasetUrn : datasetUrns) {
 String key = Guid.fromStrings(datasetUrn).toString();
 if (!this.sanitizedNameToDatasetURNMap.containsKey(key)) {
  this.sanitizedNameToDatasetURNMap.put(key, datasetUrn);

代码示例来源:origin: apache/incubator-gobblin

private static void computeAndSetWorkUnitGuid(WorkUnit workUnit)
  throws IOException {
 Guid guid = Guid.fromStrings(workUnit.contains(ConfigurationKeys.CONVERTER_CLASSES_KEY) ? workUnit
   .getProp(ConfigurationKeys.CONVERTER_CLASSES_KEY) : "");
 setWorkUnitGuid(workUnit, guid.append(deserializeCopyEntity(workUnit)));
}

代码示例来源:origin: apache/incubator-gobblin

@Test(dependsOnMethods = {"testPersistDatasetUrns"})
public void testGetDatasetUrnFromStateStoreName()
  throws IOException {
 GuidDatasetUrnStateStoreNameParser parser =
   new GuidDatasetUrnStateStoreNameParser(this.testFs, this.jobStateRootDir);
 Assert.assertEquals(parser.sanitizedNameToDatasetURNMap.size(), 2);
 Assert.assertTrue(parser.sanitizedNameToDatasetURNMap.inverse().containsKey("dataset1"));
 Assert.assertTrue(parser.sanitizedNameToDatasetURNMap.inverse().containsKey("dataset2"));
 Assert.assertEquals(parser.getStateStoreNameFromDatasetUrn("dataset1"), Guid.fromStrings("dataset1").toString());
 Assert.assertEquals(parser.getStateStoreNameFromDatasetUrn("dataset2"), Guid.fromStrings("dataset2").toString());
}

代码示例来源:origin: apache/incubator-gobblin

Guid newGuid = oldGuid.append(Guid.fromStrings(serializedSplit));

代码示例来源:origin: apache/incubator-gobblin

private Collection<WorkUnit> createMockSplitWorkUnits(FileSystem fs, long fileLen, long blockSize, long maxSplitSize)
  throws Exception {
 FileStatus file = mock(FileStatus.class);
 when(file.getLen()).thenReturn(fileLen);
 when(file.getBlockSize()).thenReturn(blockSize);
 URI uri = new URI("hdfs", "dummyhost", "/test", "test");
 Path path = new Path(uri);
 when(fs.getUri()).thenReturn(uri);
 CopyableDatasetMetadata cdm = new CopyableDatasetMetadata(new TestCopyableDataset(path));
 CopyableFile cf = CopyableFileUtils.getTestCopyableFile();
 CopyableFile spy = spy(cf);
 doReturn(file).when(spy).getFileStatus();
 doReturn(blockSize).when(spy).getBlockSize(any(FileSystem.class));
 doReturn(path).when(spy).getDestination();
 WorkUnit wu = WorkUnit.createEmpty();
 wu.setProp(DistcpFileSplitter.MAX_SPLIT_SIZE_KEY, maxSplitSize);
 wu.setProp(ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_OUTPUT_DIR, 1, 0),
   path.toString());
 CopySource.setWorkUnitGuid(wu, Guid.fromStrings(wu.toString()));
 CopySource.serializeCopyEntity(wu, cf);
 CopySource.serializeCopyableDataset(wu, cdm);
 return DistcpFileSplitter.splitFile(spy, wu, fs);
}

代码示例来源:origin: org.apache.gobblin/gobblin-data-management

@Override
public Guid guid() throws IOException {
 return Guid.fromStrings(toString());
}

代码示例来源:origin: org.apache.gobblin/gobblin-metastore

@Override
 public String getStateStoreNameFromDatasetUrn(String datasetUrn)
   throws IOException {
  if (!this.sanitizedNameToDatasetURNMap.inverse().containsKey(datasetUrn)) {
   String guid = Guid.fromStrings(datasetUrn).toString();
   this.sanitizedNameToDatasetURNMap.put(guid, datasetUrn);
  }
  return this.sanitizedNameToDatasetURNMap.inverse().get(datasetUrn);
 }
}

代码示例来源:origin: org.apache.gobblin/gobblin-data-management

/**
 * Generates a replicable guid to uniquely identify the origin of this {@link CopyableFile}.
 * @return a guid uniquely identifying the origin file.
 */
@Override
public Guid guid() throws IOException {
 StringBuilder uniqueString = new StringBuilder();
 uniqueString.append(getFileStatus().getModificationTime());
 uniqueString.append(getFileStatus().getLen());
 uniqueString.append(getFileStatus().getPath());
 return Guid.fromStrings(uniqueString.toString());
}

代码示例来源:origin: org.apache.gobblin/gobblin-metastore

throws IOException {
for (String datasetUrn : datasetUrns) {
 String key = Guid.fromStrings(datasetUrn).toString();
 if (!this.sanitizedNameToDatasetURNMap.containsKey(key)) {
  this.sanitizedNameToDatasetURNMap.put(key, datasetUrn);

代码示例来源:origin: org.apache.gobblin/gobblin-data-management

Guid newGuid = oldGuid.append(Guid.fromStrings(serializedSplit));

代码示例来源:origin: org.apache.gobblin/gobblin-data-management

private static void computeAndSetWorkUnitGuid(WorkUnit workUnit)
  throws IOException {
 Guid guid = Guid.fromStrings(workUnit.contains(ConfigurationKeys.CONVERTER_CLASSES_KEY) ? workUnit
   .getProp(ConfigurationKeys.CONVERTER_CLASSES_KEY) : "");
 setWorkUnitGuid(workUnit, guid.append(deserializeCopyEntity(workUnit)));
}

相关文章