本文整理汇总了Java中org.gbif.dwc.terms.GbifTerm类的典型用法代码示例。如果您正苦于以下问题:Java GbifTerm类的具体用法?Java GbifTerm怎么用?Java GbifTerm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GbifTerm类属于org.gbif.dwc.terms包,在下文中一共展示了GbifTerm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPropertyMap
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
public static Map<Term, String> getPropertyMap(Term conceptTerm) {
if(conceptTerm.equals(DwcTerm.Taxon)) {
return taxonTerms;
} else if(conceptTerm.equals(GbifTerm.Description)) {
return descriptionTerms;
} else if(conceptTerm.equals(GbifTerm.Distribution)) {
return distributionTerms;
} else if(conceptTerm.equals(GbifTerm.Identifier)) {
return identifierTerms;
} else if(conceptTerm.equals(DwcTerm.MeasurementOrFact)) {
return measurementOrFactTerms;
} else if(conceptTerm.equals(GbifTerm.VernacularName)) {
return vernacularNameTerms;
} else if(conceptTerm.equals(GbifTerm.Image)) {
return imageTerms;
} else if(conceptTerm.equals(GbifTerm.TypesAndSpecimen)) {
return typeAndSpecimenTerms;
} else if(conceptTerm.equals(GbifTerm.Reference)) {
return referenceTerms;
} else if(conceptTerm.equals(SkosTerm.Concept)) {
return skosTerms;
} else {
throw new IllegalArgumentException(conceptTerm.qualifiedName() + " is not a supported term");
}
}
开发者ID:RBGKew,项目名称:eMonocot,代码行数:26,代码来源:DarwinCorePropertyMap.java
示例2: getPropertyMap
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
public static Map<Term, String> getPropertyMap(Term conceptTerm) {
if(conceptTerm.equals(DwcTerm.Taxon)) {
return taxonTerms;
} else if(conceptTerm.equals(GbifTerm.Description)) {
return descriptionTerms;
} else if(conceptTerm.equals(GbifTerm.Distribution)) {
return distributionTerms;
} else if(conceptTerm.equals(GbifTerm.Identifier)) {
return identifierTerms;
} else if(conceptTerm.equals(DwcTerm.MeasurementOrFact)) {
return measurementOrFactTerms;
} else if(conceptTerm.equals(GbifTerm.VernacularName)) {
return vernacularNameTerms;
} else if(conceptTerm.equals(ExtendedAcTerm.Multimedia)) {
return imageTerms;
} else if(conceptTerm.equals(GbifTerm.TypesAndSpecimen)) {
return typeAndSpecimenTerms;
} else if(conceptTerm.equals(GbifTerm.Reference)) {
return referenceTerms;
} else if(conceptTerm.equals(SkosTerm.Concept)) {
return skosTerms;
} else {
throw new IllegalArgumentException(conceptTerm.qualifiedName() + " is not a supported term");
}
}
开发者ID:RBGKew,项目名称:powop,代码行数:26,代码来源:DarwinCorePropertyMap.java
示例3: testHeaders3
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test(expected = IllegalStateException.class)
public void testHeaders3() throws Exception {
File dwcaDir = FileUtils.createTempDir();
dwcaDir.deleteOnExit();
DwcaWriter writer = new DwcaWriter(DwcTerm.Taxon, dwcaDir, true);
writer.newRecord("dummy1");
writer.addCoreColumn(DwcTerm.parentNameUsageID);
writer.addCoreColumn(DwcTerm.acceptedNameUsageID);
// define extension columns
Map<Term, String> eData = Maps.newHashMap();
eData.put(DwcTerm.locality, "locality1");
eData.put(DwcTerm.occurrenceStatus, "present");
writer.addExtensionRecord(GbifTerm.Distribution, eData);
eData.put(DwcTerm.establishmentMeans, "alien");
writer.addExtensionRecord(GbifTerm.Distribution, eData);
}
开发者ID:gbif,项目名称:dwca-io,代码行数:20,代码来源:DwcaWriterTest.java
示例4: interpretVernacularNames
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
private void interpretVernacularNames(NameUsage u, UsageExtensions e, VerbatimNameUsage v) {
if (v.hasExtension(Extension.VERNACULAR_NAME)) {
for (Map<Term, String> rec : v.getExtensions().get(Extension.VERNACULAR_NAME)) {
VernacularName vn = new VernacularName();
vn.setVernacularName(value(rec, DwcTerm.vernacularName));
if (vn.getVernacularName() == null) {
u.addIssue(NameUsageIssue.VERNACULAR_NAME_INVALID);
continue;
}
// locationID > locality
vn.setArea(value(rec, DwcTerm.locationID, DwcTerm.locality));
vn.setCountry(enumify(rec, null, countryParser, u,
DwcTerm.countryCode, DwcTerm.country, DwcTerm.locationID, DwcTerm.locality));
vn.setLanguage(enumify(rec, NameUsageIssue.VERNACULAR_NAME_INVALID, languageParser, u, DcTerm.language));
vn.setLifeStage(enumify(rec, NameUsageIssue.VERNACULAR_NAME_INVALID, lifeStageParser, u, DwcTerm.lifeStage));
vn.setPlural(bool(rec, NameUsageIssue.VERNACULAR_NAME_INVALID, u, GbifTerm.isPlural));
vn.setPreferred(bool(rec, NameUsageIssue.VERNACULAR_NAME_INVALID, u, GbifTerm.isPreferredName));
vn.setSex(enumify(rec, NameUsageIssue.VERNACULAR_NAME_INVALID, sexParser, u, DwcTerm.sex));
vn.setSource(value(rec, DcTerm.source));
// interpret rec
e.vernacularNames.add(vn);
}
}
}
开发者ID:gbif,项目名称:checklistbank,代码行数:25,代码来源:ExtensionInterpreter.java
示例5: interpretTypes
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
/**
* We only keep type names and ignore specimens...
*/
private void interpretTypes(NameUsage u, UsageExtensions e, VerbatimNameUsage v) {
if (v.hasExtension(Extension.TYPES_AND_SPECIMEN)) {
for (Map<Term, String> rec : v.getExtensions().get(Extension.TYPES_AND_SPECIMEN)) {
TypeSpecimen t = new TypeSpecimen();
// interpret
t.setScientificName(expandGenus(value(rec, DwcTerm.scientificName), u.getScientificName()));
if (t.getScientificName() == null || t.getScientificName().equalsIgnoreCase(u.getScientificName())) {
LOG.debug("Ignore type name for {} as the name is the same as the taxon", u.getScientificName());
continue;
}
t.setTypeDesignatedBy(value(rec, GbifTerm.typeDesignatedBy));
t.setTypeStatus(enumify(rec, null, typeStatusParser, u, DwcTerm.typeStatus));
t.setSource(value(rec, DcTerm.source));
//t.setCitation(value(rec, DcTerm.bibliographicCitation));
//t.setTypeDesignationType(value(rec, GbifTerm.typeDesignatedType));
e.typeSpecimens.add(t);
}
}
}
开发者ID:gbif,项目名称:checklistbank,代码行数:24,代码来源:ExtensionInterpreter.java
示例6: interpretSpeciesProfiles
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
private void interpretSpeciesProfiles(NameUsage u, UsageExtensions e, VerbatimNameUsage v) {
if (v.hasExtension(Extension.SPECIES_PROFILE)) {
for (Map<Term, String> rec : v.getExtensions().get(Extension.SPECIES_PROFILE)) {
SpeciesProfile s = new SpeciesProfile();
// interpret rec
s.setSource(value(rec, DcTerm.source));
s.setAgeInDays(integer(rec, NameUsageIssue.SPECIES_PROFILE_INVALID, u, GbifTerm.ageInDays));
s.setMassInGram(integer(rec, NameUsageIssue.SPECIES_PROFILE_INVALID, u, GbifTerm.massInGram));
s.setSizeInMillimeter(integer(rec, NameUsageIssue.SPECIES_PROFILE_INVALID, u, GbifTerm.sizeInMillimeter));
s.setHybrid(bool(rec, NameUsageIssue.SPECIES_PROFILE_INVALID, u, GbifTerm.isHybrid));
s.setMarine(bool(rec, NameUsageIssue.SPECIES_PROFILE_INVALID, u, GbifTerm.isMarine));
s.setFreshwater(bool(rec, NameUsageIssue.SPECIES_PROFILE_INVALID, u, GbifTerm.isFreshwater));
s.setTerrestrial(bool(rec, NameUsageIssue.SPECIES_PROFILE_INVALID, u, GbifTerm.isTerrestrial));
s.setExtinct(bool(rec, NameUsageIssue.SPECIES_PROFILE_INVALID, u, GbifTerm.isExtinct));
s.setLivingPeriod(value(rec, GbifTerm.livingPeriod));
s.setLifeForm(value(rec, GbifTerm.lifeForm));
s.setHabitat(value(rec, DwcTerm.habitat));
e.speciesProfiles.add(s);
}
}
}
开发者ID:gbif,项目名称:checklistbank,代码行数:22,代码来源:ExtensionInterpreter.java
示例7: testRoundTripping
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test
public void testRoundTripping() throws Exception {
VerbatimNameUsage v = new VerbatimNameUsage();
v.setCoreField(DwcTerm.scientificName, "Abies alba");
v.setCoreField(DwcTerm.taxonRank, "Gattung");
v.setCoreField(DwcTerm.taxonID, "dqwd23");
v.setCoreField(GbifTerm.depth, "1200");
v.setCoreField(new UnknownTerm(qname1), "1200");
v.setCoreField(new UnknownTerm(qname2), null);
List<Map<Term, String>> vernaculars = Lists.newArrayList();
vernaculars.add(map(DwcTerm.vernacularName, "Tanne", DcTerm.language, "de"));
vernaculars.add(map(DwcTerm.vernacularName, "Fir", DcTerm.language, "en", new UnknownTerm(qname2), ""));
v.getExtensions().put(Extension.VERNACULAR_NAME, vernaculars);
List<Map<Term, String>> infos = Lists.newArrayList();
infos.add(map(GbifTerm.ageInDays, "750", IucnTerm.threatStatus, "extinct", GbifTerm.isExtinct, "true"));
v.getExtensions().put(Extension.SPECIES_PROFILE, infos);
String json = mapper.write(v);
VerbatimNameUsage v2 = mapper.read(json);
assertEquals(v, v2);
}
开发者ID:gbif,项目名称:checklistbank,代码行数:25,代码来源:VerbatimNameUsageMapperJsonTest.java
示例8: testOcc
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test
public void testOcc() throws IOException {
ObjectMapper mapper = new ObjectMapper();
final Term custom = UnknownTerm.build("http://me.com/mum", "mum");
Occ o = new Occ();
o.setTerm(custom);
o.getData().put(custom, "custom");
o.getData().put(GbifTerm.ageInDays, "21");
for (Term t : DwcTerm.values()) {
o.getData().put(t, t.simpleName());
}
String json = mapper.writeValueAsString(o);
Occ o2 = mapper.readValue(json, Occ.class);
System.out.println(o.equals(o2));
assertEquals(o, mapper.readValue(json, Occ.class));
}
开发者ID:gbif,项目名称:dwc-api,代码行数:21,代码来源:TermDeserializerTest.java
示例9: selectVerbatimFields
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
/**
* @return the select fields for the verbatim table in the simple download
*/
static List<InitializableField> selectVerbatimFields() {
ImmutableList.Builder<InitializableField> builder = ImmutableList.builder();
// always add the GBIF ID
builder.add(new InitializableField(GbifTerm.gbifID,
HiveColumns.columnFor(GbifTerm.gbifID),
HiveDataTypes.typeForTerm(GbifTerm.gbifID, true)));
for (Term term : DownloadTerms.DOWNLOAD_VERBATIM_TERMS) {
if (GbifTerm.gbifID == term) {
continue; // for safety, we code defensively as it may be added
}
builder.add(new InitializableField(term,
HiveColumns.VERBATIM_COL_PREFIX + term.simpleName().toLowerCase(),
// no escape needed due to prefix
HiveDataTypes.TYPE_STRING));
}
return builder.build();
}
开发者ID:gbif,项目名称:occurrence,代码行数:23,代码来源:Queries.java
示例10: selectDownloadFields
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
/**
* @return the select fields for the interpreted table in the simple download
*/
private static List<InitializableField> selectDownloadFields(Set<Term> terms, boolean useInitializers) {
ImmutableList.Builder<InitializableField> builder = ImmutableList.builder();
// always add the GBIF ID
builder.add(new InitializableField(GbifTerm.gbifID,
HiveColumns.columnFor(GbifTerm.gbifID),
HiveDataTypes.typeForTerm(GbifTerm.gbifID, true)));
for (Term term : terms) {
if (GbifTerm.gbifID == term) {
continue; // for safety, we code defensively as it may be added
}
if (useInitializers && TermUtils.isInterpretedDate(term)) {
builder.add(new InitializableField(term, toISO8601Initializer(term), HiveDataTypes.TYPE_STRING));
} else if (useInitializers && HiveColumnsUtils.isHiveArray(term)){
builder.add(new InitializableField(term, String.format(JOIN_ARRAY_FMT,HiveColumns.columnFor(term)), HiveDataTypes.TYPE_STRING));
} else {
builder.add(new InitializableField(term, HiveColumns.columnFor(term), HiveDataTypes.TYPE_STRING));
}
}
return builder.build();
}
开发者ID:gbif,项目名称:occurrence,代码行数:25,代码来源:Queries.java
示例11: createArchiveFile
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
/**
* Creates a new archive file description for a dwc archive and sets the id field to the column of gbifID.
* Used to generate the meta.xml with the help of the dwca-writer
*/
public static ArchiveFile createArchiveFile(String filename, Term rowType, Iterable<? extends Term> columns) {
ArchiveFile af = buildBaseArchive(filename, rowType);
int index = 0;
for (Term term : columns) {
ArchiveField field = new ArchiveField();
field.setIndex(index);
field.setTerm(term);
if (HiveColumnsUtils.isHiveArray(term)) {
field.setDelimitedBy(DEFAULT_DELIMITER);
}
af.addField(field);
index++;
}
ArchiveField coreId = af.getField(GbifTerm.gbifID);
if (coreId == null) {
throw new IllegalArgumentException("Archive columns MUST include the gbif:gbifID term");
}
af.setId(coreId);
return af;
}
开发者ID:gbif,项目名称:occurrence,代码行数:25,代码来源:DwcArchiveUtils.java
示例12: createArchiveDescriptor
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
/**
* Creates an meta.xml descriptor file in the directory parameter.
*/
public static void createArchiveDescriptor(File directory) {
LOG.info("Creating archive meta.xml descriptor");
Archive downloadArchive = new Archive();
downloadArchive.setMetadataLocation(METADATA_FILENAME);
ArchiveFile occurrence = createArchiveFile(INTERPRETED_FILENAME, DwcTerm.Occurrence, TermUtils.interpretedTerms());
downloadArchive.setCore(occurrence);
ArchiveFile verbatim = createArchiveFile(VERBATIM_FILENAME, DwcTerm.Occurrence, TermUtils.verbatimTerms());
downloadArchive.addExtension(verbatim);
ArchiveFile multimedia = createArchiveFile(MULTIMEDIA_FILENAME, GbifTerm.Multimedia, TermUtils.multimediaTerms());
downloadArchive.addExtension(multimedia);
try {
File metaFile = new File(directory, DESCRIPTOR_FILENAME);
MetaDescriptorWriter.writeMetaFile(metaFile, downloadArchive);
} catch (IOException e) {
LOG.error("Error creating meta.xml file", e);
}
}
开发者ID:gbif,项目名称:occurrence,代码行数:26,代码来源:DwcArchiveUtils.java
示例13: testTermsConsistency
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test
public void testTermsConsistency(){
Set<Term> interpretedFromTermUtils = Sets.newHashSet(TermUtils.interpretedTerms());
Set<Term> interpretedFromTerms = Sets.newHashSet(Terms.interpretedTerms());
Set<Term> diff = Sets.symmetricDifference(interpretedFromTermUtils, interpretedFromTerms);
assertEquals("TermUtils.interpretedTerms() and Terms.interpretedTerms() must use the same terms. Difference(s): " +
diff, 0, diff.size());
Set<Term> hdfsTerms = DownloadTerms.DOWNLOAD_INTERPRETED_TERMS_HDFS;
diff = Sets.newHashSet(Sets.symmetricDifference(interpretedFromTermUtils, hdfsTerms));
diff.remove(GbifTerm.gbifID);
diff.remove(GbifTerm.mediaType);
assertEquals("TermUtils.interpretedTerms() and DownloadTerms.DOWNLOAD_INTERPRETED_TERMS_HDFS must use the same terms. Difference(s): " +
diff, 0, diff.size());
}
开发者ID:gbif,项目名称:occurrence,代码行数:18,代码来源:TestDownloadHeaders.java
示例14: deleteByColumn
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
/**
* Deletes both the secondary indexes ("lookups") as well as the occurrence proper for the scan that matches the
* given column and value. Note any exceptions thrown during the deletions will cause this method to fail, leaving
* deletions in an incomplete state.
*
* @param columnValue value to match
* @param column interpreted column on which to match values
*/
private void deleteByColumn(byte[] columnValue, GbifTerm column) {
LOG.debug("Starting delete by column for [{}]", column);
int deleteCount = 0;
Iterator<Integer> keyIterator = occurrenceService.getKeysByColumn(columnValue, Columns.column(column));
List<Integer> keys = Lists.newArrayListWithCapacity(KEYS_BATCH_SIZE);
while (keyIterator.hasNext()) {
int key = keyIterator.next();
// TODO: this is critical, but causes extreme performance problems (full scan of lookups per deleted key)
occurrenceKeyService.deleteKey(key, null);
keys.add(key);
if ((keys.size() % KEYS_BATCH_SIZE) == 0) {
LOG.debug("Writing batch of [{}] deletes", keys.size());
occurrenceService.delete(keys);
deleteCount += keys.size();
keys = Lists.newArrayListWithCapacity(KEYS_BATCH_SIZE);
}
}
LOG.debug("Writing batch of [{}] deletes", keys.size());
occurrenceService.delete(keys);
deleteCount += keys.size();
LOG.debug("Finished delete by column for [{}] giving [{}] total rows deleted", column, deleteCount);
}
开发者ID:gbif,项目名称:occurrence,代码行数:31,代码来源:DatasetDeletionServiceImpl.java
示例15: testVerbRowMutations
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test
public void testVerbRowMutations() {
// identical shouldn't do anything
VerbatimOccurrence occ = occurrenceService.getVerbatim(KEY);
RowMutations mutations = occurrenceService.buildRowUpdate(occ).getRowMutations();
assertEquals(0, mutations.getMutations().size());
// one put and three deletes
occ = occurrenceService.getVerbatim(KEY);
occ.setLastParsed(new Date());
occ.setVerbatimField(DwcTerm.acceptedNameUsage, null);
occ.setVerbatimField(DcTerm.accessRights, null);
occ.setVerbatimField(GbifTerm.distanceAboveSurface, null);
mutations = occurrenceService.buildRowUpdate(occ).getRowMutations();
assertEquals(4, mutations.getMutations().size());
}
开发者ID:gbif,项目名称:occurrence,代码行数:18,代码来源:OccurrencePersistenceServiceImplTest.java
示例16: testOccRowMutations
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test
public void testOccRowMutations() {
// identical shouldn't do anything
Occurrence occ = occurrenceService.get(KEY);
RowMutations mutations = occurrenceService.buildRowUpdate(occ).getRowMutations();
assertEquals(0, mutations.getMutations().size());
// one put and three deletes
occ = occurrenceService.get(KEY);
occ.setLastInterpreted(new Date());
occ.setVerbatimField(DwcTerm.acceptedNameUsage, null);
occ.setVerbatimField(DcTerm.accessRights, null);
occ.setVerbatimField(GbifTerm.ageInDays, null);
mutations = occurrenceService.buildRowUpdate(occ).getRowMutations();
assertEquals(4, mutations.getMutations().size());
}
开发者ID:gbif,项目名称:occurrence,代码行数:17,代码来源:OccurrencePersistenceServiceImplTest.java
示例17: testDatasetKeyExists
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test
public void testDatasetKeyExists() {
Iterator<Integer> iterator =
occurrenceService.getKeysByColumn(Bytes.toBytes(GOOD_DATASET_KEY.toString()), Columns.column(GbifTerm.datasetKey));
int count = 0;
while (iterator.hasNext()) {
iterator.next();
count++;
}
assertEquals(3, count);
PublisherProvidedUniqueIdentifier uniqueId = new PublisherProvidedUniqueIdentifier(GOOD_DATASET_KEY, "abc3");
Set<UniqueIdentifier> uniqueIdentifiers = Sets.newHashSet();
uniqueIdentifiers.add(uniqueId);
KeyLookupResult result = occurrenceKeyService.findKey(uniqueIdentifiers);
assertEquals(3, result.getKey());
deletionService.deleteDataset(GOOD_DATASET_KEY);
iterator = occurrenceService.getKeysByColumn(Bytes.toBytes(GOOD_DATASET_KEY.toString()), Columns.column(GbifTerm.datasetKey));
assertFalse(iterator.hasNext());
result = occurrenceKeyService.findKey(uniqueIdentifiers);
assertNull(result);
}
开发者ID:gbif,项目名称:occurrence,代码行数:24,代码来源:DatasetDeletionServiceImplTest.java
示例18: testOneRecord
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test
public void testOneRecord() throws IOException {
TEST_UTIL.truncateTable(TABLE);
try (Table table = CONNECTION.getTable(TABLE_NAME)) {
addId(1, DATASET_1.toString(), table);
}
byte[] col = Bytes.toBytes(Columns.column(GbifTerm.datasetKey));
Scan scan = new Scan();
scan.addColumn(CF, col);
scan.setCaching(500);
SingleColumnValueFilter filter =
new SingleColumnValueFilter(CF, col, CompareFilter.CompareOp.EQUAL, Bytes.toBytes(DATASET_1.toString()));
scan.setFilter(filter);
Iterator<Integer> iterator = new OccurrenceKeyIterator(CONNECTION, TABLE_NAME.getNameAsString(), scan);
int count = 0;
while (iterator.hasNext()) {
iterator.next();
count++;
}
assertEquals(1, count);
}
开发者ID:gbif,项目名称:occurrence,代码行数:24,代码来源:OccurrenceKeyIteratorTest.java
示例19: testOnePage
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test
public void testOnePage() {
byte[] col = Bytes.toBytes(Columns.column(GbifTerm.datasetKey));
Scan scan = new Scan();
scan.addColumn(CF, col);
scan.setCaching(500);
SingleColumnValueFilter filter = new SingleColumnValueFilter(CF, col, CompareFilter.CompareOp.EQUAL,
Bytes.toBytes(DATASET_1.toString()));
scan.setFilter(filter);
Iterator<Integer> iterator = new OccurrenceKeyIterator(CONNECTION, TABLE_NAME.getNameAsString(), scan);
int count = 0;
while (iterator.hasNext()) {
iterator.next();
count++;
}
assertEquals(ID_1_COUNT, count);
}
开发者ID:gbif,项目名称:occurrence,代码行数:19,代码来源:OccurrenceKeyIteratorTest.java
示例20: testMultiPage
import org.gbif.dwc.terms.GbifTerm; //导入依赖的package包/类
@Test
public void testMultiPage() {
byte[] col = Bytes.toBytes(Columns.column(GbifTerm.datasetKey));
Scan scan = new Scan();
scan.addColumn(CF, col);
scan.setCaching(500);
SingleColumnValueFilter filter = new SingleColumnValueFilter(CF, col, CompareFilter.CompareOp.EQUAL,
Bytes.toBytes(DATASET_3.toString()));
scan.setFilter(filter);
Iterator<Integer> iterator = new OccurrenceKeyIterator(CONNECTION, TABLE_NAME.getNameAsString(), scan);
int count = 0;
while (iterator.hasNext()) {
iterator.next();
count++;
}
assertEquals(ID_3_COUNT, count);
}
开发者ID:gbif,项目名称:occurrence,代码行数:19,代码来源:OccurrenceKeyIteratorTest.java
注:本文中的org.gbif.dwc.terms.GbifTerm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论