@Override public Float get() { assertNotNull( storeScan ); PopulationProgress progress = storeScan.getProgress(); return (float) progress.getCompleted() / (float) progress.getTotal(); }
@Override public IndexPopulationProgress getIndexPopulationProgress( IndexDefinition index ) { KernelTransaction transaction = safeAcquireTransaction( transactionSupplier ); try ( Statement ignore = transaction.acquireStatement() ) { SchemaRead schemaRead = transaction.schemaRead(); IndexReference descriptor = getIndexReference( schemaRead, transaction.tokenRead(), (IndexDefinitionImpl) index ); PopulationProgress progress = schemaRead.indexGetPopulationProgress( descriptor ); return new IndexPopulationProgress( progress.getCompleted(), progress.getTotal() ); } catch ( SchemaRuleNotFoundException | IndexNotFoundKernelException e ) { throw newIndexNotFoundException( index, e ); } }
Map<String,String> providerDescriptorMap = indexProviderDescriptorMap( schemaRead.index( schema ) ); PopulationProgress progress = schemaRead.indexGetPopulationProgress( index ); IndexPopulationProgress indexProgress = new IndexPopulationProgress( progress.getCompleted(), progress.getTotal() ); String failureMessage = internalIndexState == InternalIndexState.FAILED ? schemaRead.indexGetFailure( index ) : ""; result.add( new IndexResult( indexId,
@Test public void testManualIndexPopulation() throws InterruptedException, IndexNotFoundKernelException { try ( Transaction tx = database.beginTx() ) { database.schema().indexFor( Label.label( FOOD_LABEL ) ).on( PROPERTY_NAME ).create(); tx.success(); } int labelId = getLabelId( FOOD_LABEL ); int propertyKeyId = getPropertyKeyId( PROPERTY_NAME ); IndexingService indexingService = getIndexingService( database ); IndexProxy indexProxy = indexingService.getIndexProxy( forLabel( labelId, propertyKeyId ) ); waitIndexOnline( indexProxy ); assertEquals( InternalIndexState.ONLINE, indexProxy.getState() ); PopulationProgress progress = indexProxy.getIndexPopulationProgress(); assertEquals( progress.getCompleted(), progress.getTotal() ); }
@Test public void testManualRelationshipIndexPopulation() throws Exception { RelationTypeSchemaDescriptor descriptor; try ( org.neo4j.internal.kernel.api.Transaction tx = ((GraphDatabaseAPI) database).getDependencyResolver().resolveDependency( Kernel.class ).beginTransaction( explicit, AUTH_DISABLED ) ) { int foodId = tx.tokenWrite().relationshipTypeGetOrCreateForName( FOOD_LABEL ); int propertyId = tx.tokenWrite().propertyKeyGetOrCreateForName( PROPERTY_NAME ); descriptor = forRelType( foodId, propertyId ); tx.schemaWrite().indexCreate( descriptor ); tx.success(); } IndexingService indexingService = getIndexingService( database ); IndexProxy indexProxy = indexingService.getIndexProxy( descriptor ); waitIndexOnline( indexProxy ); assertEquals( InternalIndexState.ONLINE, indexProxy.getState() ); PopulationProgress progress = indexProxy.getIndexPopulationProgress(); assertEquals( progress.getCompleted(), progress.getTotal() ); }
!indexReference.isUnique() ? "INDEX" : "UNIQUENESS", schemaRead.indexGetState(indexReference).equals(InternalIndexState.FAILED) ? schemaRead.indexGetFailure(indexReference) : "NO FAILURE", schemaRead.indexGetPopulationProgress(indexReference).getCompleted() / schemaRead.indexGetPopulationProgress(indexReference).getTotal() * 100, schemaRead.indexSize(indexReference), schemaRead.indexUniqueValuesSelectivity(indexReference),
@Override public IndexPopulationProgress getIndexPopulationProgress( IndexDefinition index ) { KernelTransaction transaction = safeAcquireTransaction( transactionSupplier ); try ( Statement ignore = transaction.acquireStatement() ) { SchemaRead schemaRead = transaction.schemaRead(); IndexReference descriptor = getIndexReference( schemaRead, transaction.tokenRead(), (IndexDefinitionImpl) index ); PopulationProgress progress = schemaRead.indexGetPopulationProgress( descriptor ); return new IndexPopulationProgress( progress.getCompleted(), progress.getTotal() ); } catch ( SchemaRuleNotFoundException | IndexNotFoundKernelException e ) { throw newIndexNotFoundException( index, e ); } }
Map<String,String> providerDescriptorMap = indexProviderDescriptorMap( schemaRead.index( schema ) ); PopulationProgress progress = schemaRead.indexGetPopulationProgress( index ); IndexPopulationProgress indexProgress = new IndexPopulationProgress( progress.getCompleted(), progress.getTotal() ); String failureMessage = internalIndexState == InternalIndexState.FAILED ? schemaRead.indexGetFailure( index ) : ""; result.add( new IndexResult( indexId,