本文整理汇总了Java中me.prettyprint.hector.api.beans.OrderedRows类的典型用法代码示例。如果您正苦于以下问题:Java OrderedRows类的具体用法?Java OrderedRows怎么用?Java OrderedRows使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OrderedRows类属于me.prettyprint.hector.api.beans包,在下文中一共展示了OrderedRows类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getNamespace
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
protected Namespace getNamespace( String repositoryId, String namespaceId )
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getNamespaceFamilyName() ) //
.setColumnNames( REPOSITORY_NAME.toString(), NAME.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repositoryId ) //
.addEqualsExpression( NAME.toString(), namespaceId ) //
.execute();
if ( result.get().getCount() > 0 )
{
ColumnSlice<String, String> columnSlice = result.get().getList().get( 0 ).getColumnSlice();
return new Namespace( getStringValue( columnSlice, NAME.toString() ), //
new Repository( getStringValue( columnSlice, REPOSITORY_NAME.toString() ) ) );
}
return null;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:20,代码来源:CassandraMetadataRepository.java
示例2: getRootNamespaces
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public Collection<String> getRootNamespaces( final String repoId )
throws MetadataResolutionException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getNamespaceFamilyName() ) //
.setColumnNames( NAME.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repoId ) //
.execute();
Set<String> namespaces = new HashSet<String>( result.get().getCount() );
for ( Row<String, String, String> row : result.get() )
{
namespaces.add( StringUtils.substringBefore( getStringValue( row.getColumnSlice(), NAME.toString() ), "." ) );
}
return namespaces;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:22,代码来源:CassandraMetadataRepository.java
示例3: getNamespaces
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
protected List<String> getNamespaces( final String repoId )
throws MetadataResolutionException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getNamespaceFamilyName() ) //
.setColumnNames( NAME.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repoId ) //
.execute();
List<String> namespaces = new ArrayList<>( result.get().getCount() );
for ( Row<String, String, String> row : result.get() )
{
namespaces.add( getStringValue( row.getColumnSlice(), NAME.toString() ) );
}
return namespaces;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:21,代码来源:CassandraMetadataRepository.java
示例4: getProjects
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public Collection<String> getProjects( final String repoId, final String namespace )
throws MetadataResolutionException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getProjectFamilyName() ) //
.setColumnNames( PROJECT_ID.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repoId ) //
.addEqualsExpression( NAMESPACE_ID.toString(), namespace ) //
.execute();
final Set<String> projects = new HashSet<String>( result.get().getCount() );
for ( Row<String, String, String> row : result.get() )
{
projects.add( getStringValue( row.getColumnSlice(), PROJECT_ID.toString() ) );
}
return projects;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:23,代码来源:CassandraMetadataRepository.java
示例5: removeMailingList
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
protected void removeMailingList( String projectVersionMetadataKey )
{
QueryResult<OrderedRows<String, String, String>> result =
HFactory.createRangeSlicesQuery( cassandraArchivaManager.getKeyspace(), ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getMailingListFamilyName() ) //
.setColumnNames( NAME.toString() ) //
.setRowCount( Integer.MAX_VALUE ) //
.addEqualsExpression( "projectVersionMetadataModel.key", projectVersionMetadataKey ) //
.execute();
if ( result.get().getCount() < 1 )
{
return;
}
for ( Row<String, String, String> row : result.get() )
{
this.mailingListTemplate.deleteRow( row.getKey() );
}
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:23,代码来源:CassandraMetadataRepository.java
示例6: getLicenses
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
protected List<License> getLicenses( String projectVersionMetadataKey )
{
List<License> licenses = new ArrayList<>();
QueryResult<OrderedRows<String, String, String>> result =
HFactory.createRangeSlicesQuery( cassandraArchivaManager.getKeyspace(), ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getLicenseFamilyName() ) //
.setColumnNames( "projectVersionMetadataModel.key" ) //
.setRowCount( Integer.MAX_VALUE ) //
.addEqualsExpression( "projectVersionMetadataModel.key", projectVersionMetadataKey ) //
.execute();
for ( Row<String, String, String> row : result.get() )
{
ColumnFamilyResult<String, String> columnFamilyResult = this.licenseTemplate.queryColumns( row.getKey() );
licenses.add(
new License( columnFamilyResult.getString( NAME.toString() ), columnFamilyResult.getString( URL.toString() ) ) );
}
return licenses;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:23,代码来源:CassandraMetadataRepository.java
示例7: getArtifactVersions
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public Collection<String> getArtifactVersions( final String repoId, final String namespace, final String projectId,
final String projectVersion )
throws MetadataResolutionException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getProjectVersionMetadataFamilyName() ) //
.setColumnNames( VERSION.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repoId ) //
.addEqualsExpression( NAMESPACE_ID.toString(), namespace ) //
.addEqualsExpression( PROJECT_ID.toString(), projectId ) //
.addEqualsExpression( PROJECT_VERSION.toString(), projectVersion ) //
.execute();
final Set<String> versions = new HashSet<String>();
for ( Row<String, String, String> row : result.get() )
{
versions.add( getStringValue( row.getColumnSlice(), VERSION.toString() ) );
}
return versions;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:27,代码来源:CassandraMetadataRepository.java
示例8: getMetadataFacets
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public List<String> getMetadataFacets( final String repositoryId, final String facetId )
throws MetadataRepositoryException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getMetadataFacetFamilyName() ) //
.setColumnNames( NAME.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repositoryId ) //
.addEqualsExpression( FACET_ID.toString(), facetId ) //
.execute();
final List<String> facets = new ArrayList<>();
for ( Row<String, String, String> row : result.get() )
{
facets.add( getStringValue( row.getColumnSlice(), NAME.toString() ) );
}
return facets;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:22,代码来源:CassandraMetadataRepository.java
示例9: removeMetadataFacets
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public void removeMetadataFacets( final String repositoryId, final String facetId )
throws MetadataRepositoryException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getMetadataFacetFamilyName() ) //
.setColumnNames( KEY.toString(), VALUE.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repositoryId ) //
.addEqualsExpression( FACET_ID.toString(), facetId ) //
.execute();
for ( Row<String, String, String> row : result.get() )
{
this.metadataFacetTemplate.deleteRow( row.getKey() );
}
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:20,代码来源:CassandraMetadataRepository.java
示例10: removeMetadataFacet
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public void removeMetadataFacet( final String repositoryId, final String facetId, final String name )
throws MetadataRepositoryException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getMetadataFacetFamilyName() ) //
.setColumnNames( KEY.toString(), VALUE.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repositoryId ) //
.addEqualsExpression( FACET_ID.toString(), facetId ) //
.addEqualsExpression( NAME.toString(), name ) //
.execute();
for ( Row<String, String, String> row : result.get() )
{
this.metadataFacetTemplate.deleteRow( row.getKey() );
}
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:20,代码来源:CassandraMetadataRepository.java
示例11: removeArtifact
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public void removeArtifact( final String repositoryId, final String namespace, final String project,
final String version, final MetadataFacet metadataFacet )
throws MetadataRepositoryException
{
RangeSlicesQuery<String, String, String> query = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getArtifactMetadataFamilyName() ) //
.setColumnNames( NAMESPACE_ID.toString() ); //
query = query.addEqualsExpression( REPOSITORY_NAME.toString(), repositoryId ) //
.addEqualsExpression( NAMESPACE_ID.toString(), namespace ) //
.addEqualsExpression( PROJECT.toString(), project ) //
.addEqualsExpression( VERSION.toString(), version );
QueryResult<OrderedRows<String, String, String>> result = query.execute();
for ( Row<String, String, String> row : result.get() )
{
this.artifactMetadataTemplate.deleteRow( row.getKey() );
}
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:24,代码来源:CassandraMetadataRepository.java
示例12: getArtifacts
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public List<ArtifactMetadata> getArtifacts( final String repositoryId )
throws MetadataRepositoryException
{
RangeSlicesQuery<String, String, String> query = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getArtifactMetadataFamilyName() ) //
.setColumnNames( ArtifactMetadataModel.COLUMNS ); //
query = query.addEqualsExpression( REPOSITORY_NAME.toString(), repositoryId );
QueryResult<OrderedRows<String, String, String>> result = query.execute();
List<ArtifactMetadata> artifactMetadatas = new ArrayList<>( result.get().getCount() );
for ( Row<String, String, String> row : result.get() )
{
ColumnSlice<String, String> columnSlice = row.getColumnSlice();
artifactMetadatas.add( mapArtifactMetadataStringColumnSlice( columnSlice ) );
}
return artifactMetadatas;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:27,代码来源:CassandraMetadataRepository.java
示例13: doScan
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void doScan(byte[] beginKey, byte[] endKey,
IKeyValueCallback callback, boolean includeValue)
throws StorageException {
try {
RangeSlicesQuery<byte[], String, byte[]> query = prepareRangeQuery(
beginKey, endKey, includeValue);
byte[] lastKey = null;
while (true) {
if (lastKey != null) {
query.setKeys(lastKey, endKey);
}
OrderedRows<byte[], String, byte[]> rows = query.execute()
.get();
lastKey = reportScanData(rows, callback, endKey, includeValue);
if (rows.getCount() < MAX_SCAN_ROWS) {
break;
}
}
} catch (HectorException e) {
handleHectorException(e);
}
}
开发者ID:vimaier,项目名称:conqat,代码行数:27,代码来源:CassandraStore.java
示例14: reportScanData
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
/**
* Reports the data in the given row to the callback. Returns the last
* reported key (or null if no data was reported).
*/
private byte[] reportScanData(OrderedRows<byte[], String, byte[]> rows,
IKeyValueCallback callback, byte[] endKey, boolean includeValue) {
byte[] lastKey = null;
for (Row<byte[], String, byte[]> row : rows) {
byte[] key = row.getKey();
lastKey = key;
// cassandra's end key is inclusive, ours is not
if (Arrays.equals(endKey, key)) {
continue;
}
byte[] value = null;
if (includeValue) {
List<HColumn<String, byte[]>> columns = row.getColumnSlice()
.getColumns();
if (columns.isEmpty()) {
continue;
}
value = columns.get(0).getValue();
}
callback.callback(key, value);
}
return lastKey;
}
开发者ID:vimaier,项目名称:conqat,代码行数:30,代码来源:CassandraStore.java
示例15: testGetRangeSlices
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
private void testGetRangeSlices() {
Mutator<String> mutator = HFactory.createMutator(keyspace, stringSerializer);
RangeSlicesQuery<String, String, String> rangeSlicesQuery = HFactory.createRangeSlicesQuery(keyspace,
stringSerializer, stringSerializer, stringSerializer);
rangeSlicesQuery.setColumnFamily(COLUMN_FAMILY_NAME_1);
rangeSlicesQuery.setKeys("fake_key_", "");
rangeSlicesQuery.setColumnNames("birthdate");
rangeSlicesQuery.setReturnKeysOnly();
QueryResult<OrderedRows<String, String, String>> result = rangeSlicesQuery.execute();
OrderedRows<String, String, String> orderedRows = result.get();
Row<String, String, String> lastRow = orderedRows.peekLast();
System.out.println("Contents of rows: \n");
for (Row<String, String, String> r : orderedRows) {
System.out.println(" " + r);
}
}
开发者ID:xuzhikethinker,项目名称:t4f-data,代码行数:23,代码来源:HectorCassandraTest.java
示例16: getOrCreateRepository
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
/**
* if the repository doesn't exist it will be created
*
* @param repositoryId
* @return
*/
public Repository getOrCreateRepository( String repositoryId )
throws MetadataRepositoryException
{
String cf = cassandraArchivaManager.getRepositoryFamilyName();
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, StringSerializer.get(), StringSerializer.get(),
StringSerializer.get() ) //
.setColumnFamily( cf ) //
.setColumnNames( REPOSITORY_NAME.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repositoryId ) //
.execute();
if ( result.get().getCount() < 1 )
{
// we need to create the repository
Repository repository = new Repository( repositoryId );
try
{
MutationResult mutationResult = HFactory.createMutator( keyspace, StringSerializer.get() ) //
.addInsertion( repositoryId, cf,
CassandraUtils.column( REPOSITORY_NAME.toString(), repository.getName() ) ) //
.execute();
logger.debug( "time to insert repository: {}", mutationResult.getExecutionTimeMicro() );
return repository;
}
catch ( HInvalidRequestException e )
{
logger.error( e.getMessage(), e );
throw new MetadataRepositoryException( e.getMessage(), e );
}
}
return new Repository(
result.get().getList().get( 0 ).getColumnSlice().getColumnByName( REPOSITORY_NAME.toString() ).getValue() );
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:45,代码来源:CassandraMetadataRepository.java
示例17: getRepository
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
protected Repository getRepository( String repositoryId )
throws MetadataRepositoryException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, StringSerializer.get(), StringSerializer.get(),
StringSerializer.get() ) //
.setColumnFamily( cassandraArchivaManager.getRepositoryFamilyName() ) //
.setColumnNames( REPOSITORY_NAME.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repositoryId ) //
.execute();
return ( result.get().getCount() > 0 ) ? new Repository( repositoryId ) : null;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:14,代码来源:CassandraMetadataRepository.java
示例18: getRepositories
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public Collection<String> getRepositories()
throws MetadataRepositoryException
{
try
{
logger.debug( "getRepositories" );
final QueryResult<OrderedRows<String, String, String>> cResult = //
HFactory.createRangeSlicesQuery( cassandraArchivaManager.getKeyspace(), //
ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getRepositoryFamilyName() ) //
.setColumnNames( REPOSITORY_NAME.toString() ) //
.setRange( null, null, false, Integer.MAX_VALUE ) //
.execute();
List<String> repoIds = new ArrayList<>( cResult.get().getCount() );
for ( Row<String, String, String> row : cResult.get() )
{
repoIds.add( getStringValue( row.getColumnSlice(), REPOSITORY_NAME.toString() ) );
}
return repoIds;
}
catch ( PersistenceException e )
{
throw new MetadataRepositoryException( e.getMessage(), e );
}
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:32,代码来源:CassandraMetadataRepository.java
示例19: updateProject
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public void updateProject( String repositoryId, ProjectMetadata projectMetadata )
throws MetadataRepositoryException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getProjectFamilyName() ) //
.setColumnNames( PROJECT_ID.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repositoryId ) //
.addEqualsExpression( NAMESPACE_ID.toString(), projectMetadata.getNamespace() ) //
.addEqualsExpression( PROJECT_ID.toString(), projectMetadata.getId() ) //
.execute();
// project exists ? if yes return nothing to update here
if ( result.get().getCount() > 0 )
{
return;
}
else
{
Namespace namespace = updateOrAddNamespace( repositoryId, projectMetadata.getNamespace() );
String key =
new Project.KeyBuilder().withProjectId( projectMetadata.getId() ).withNamespace( namespace ).build();
String cf = cassandraArchivaManager.getProjectFamilyName();
projectTemplate.createMutator()
// values
.addInsertion( key, cf, CassandraUtils.column( PROJECT_ID.toString(), projectMetadata.getId() ) ) //
.addInsertion( key, cf, CassandraUtils.column( REPOSITORY_NAME.toString(), repositoryId ) ) //
.addInsertion( key, cf, CassandraUtils.column( NAMESPACE_ID.toString(), projectMetadata.getNamespace() ) )//
.execute();
}
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:36,代码来源:CassandraMetadataRepository.java
示例20: getProjectVersions
import me.prettyprint.hector.api.beans.OrderedRows; //导入依赖的package包/类
@Override
public Collection<String> getProjectVersions( final String repoId, final String namespace, final String projectId )
throws MetadataResolutionException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getProjectVersionMetadataFamilyName() ) //
.setColumnNames( PROJECT_VERSION.toString() ) //
.addEqualsExpression( REPOSITORY_NAME.toString(), repoId ) //
.addEqualsExpression( NAMESPACE_ID.toString(), namespace ) //
.addEqualsExpression( PROJECT_ID.toString(), projectId ) //
.execute();
int count = result.get().getCount();
if ( count < 1 )
{
return Collections.emptyList();
}
Set<String> versions = new HashSet<String>( count );
for ( Row<String, String, String> orderedRows : result.get() )
{
versions.add( getStringValue( orderedRows.getColumnSlice(), PROJECT_VERSION.toString() ) );
}
return versions;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:32,代码来源:CassandraMetadataRepository.java
注:本文中的me.prettyprint.hector.api.beans.OrderedRows类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论