CandidateResult.getVersion
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.usergrid.persistence.index.CandidateResult.getVersion(Showing top 10 results out of 315)

origin: apache/usergrid

@Override
public EntityIndexBatch deindex(final SearchEdge searchEdge, final CandidateResult entity) {
  return deindex( searchEdge, entity.getId(), entity.getVersion() );
}
@Override
origin: apache/usergrid

@Test
public void testDocumentId() {
  final ApplicationScopeImpl applicationScope = new ApplicationScopeImpl( new SimpleId( "application" ) );
  final Id id = new SimpleId( "id" );
  final UUID version = UUIDGenerator.newTimeUUID();
  final SearchEdgeImpl searchEdge =
    new SearchEdgeImpl( new SimpleId( "source" ), "users", SearchEdge.NodeType.TARGET );
  final String output = IndexingUtils.createIndexDocId( applicationScope, id, version, searchEdge );
  final String expected =
    "appId(" + applicationScope.getApplication().getUuid() + ",application).entityId(" + id.getUuid() + "," + id
      .getType() + ").version(" + version + ").nodeId(" + searchEdge.getNodeId().getUuid() + "," + searchEdge
      .getNodeId().getType() + ").edgeName(users).nodeType(TARGET)";
  assertEquals( output, expected );
  //now parse it
  final CandidateResult parsedId = parseIndexDocId( output );
  assertEquals(version, parsedId.getVersion());
  assertEquals(id, parsedId.getId());
}
origin: apache/usergrid

  /**
   * Validate each candidate results vs the data loaded from cass
   */
  private void validate( final FilterResult<Candidate> filterCandidate ) {
    final CandidateResult candidateResult = filterCandidate.getValue().getCandidateResult();
    final SearchEdge searchEdge = filterCandidate.getValue().getSearchEdge();
    final MvccLogEntry logEntry = versionSet.getMaxVersion( candidateResult.getId() );
    final UUID candidateVersion = candidateResult.getVersion();
    final UUID entityVersion = logEntry.getVersion();
    final Id entityId = logEntry.getEntityId();
    //entity is newer than ES version
    if ( UUIDComparator.staticCompare( entityVersion, candidateVersion ) > 0 ) {
      logger.warn( "Deindexing stale entity on edge {} for entityId {} and version {}",
          searchEdge, entityId, entityVersion );
      batch.deindex( searchEdge, entityId, entityVersion );
      return;
    }
    //ES is newer than cass, it means we haven't repaired the record in Cass, we don't want to
    //remove the ES record, since the read in cass should cause a read repair, just ignore
    if ( UUIDComparator.staticCompare( candidateVersion, entityVersion ) > 0 ) {
      logger.warn(
        "Found a newer version in ES over cassandra for edge {} for entityId {} and version {}.  Repair should be run",
          searchEdge, entityId, entityVersion );
    }
    //they're the same add it
    final FilterResult<Id> result = new FilterResult<>( entityId, filterCandidate.getPath() );
    results.add( result );
  }
}
origin: apache/usergrid

assertEquals(1, results.size());
assertEquals(newVersion, results.get(0).getVersion());
origin: apache/usergrid

if(candidateResult.getVersion().timestamp() <= markedVersion.timestamp()){
      candidateResult.getVersion(),
      markedVersion,
      candidateResult.getId()
    logger.trace("Candidate version {} is > provided entity version {} for entityId {}. Not" +
        "adding to candidate results",
      candidateResult.getVersion(),
      markedVersion,
      candidateResult.getId()
origin: apache/usergrid

assertEquals(entity1.getVersion(), candidate1.getVersion());
origin: apache/usergrid

assertEquals(entity1.getVersion(), candidate1.getVersion());
assertEquals( entity2.getVersion(), candidate2.getVersion() );
origin: apache/usergrid

@Test
public void testAppIdFromDocumentId() {
  final ApplicationScopeImpl applicationScope = new ApplicationScopeImpl( new SimpleId( "application" ) );
  final Id id = new SimpleId( "id" );
  final UUID version = UUIDGenerator.newTimeUUID();
  final SearchEdgeImpl searchEdge =
    new SearchEdgeImpl( new SimpleId( "source" ), "users", SearchEdge.NodeType.TARGET );
  final String output = IndexingUtils.createIndexDocId( applicationScope, id, version, searchEdge );
  final String expected =
    "appId(" + applicationScope.getApplication().getUuid() + ",application).entityId(" + id.getUuid() + "," + id
      .getType() + ").version(" + version + ").nodeId(" + searchEdge.getNodeId().getUuid() + "," + searchEdge
      .getNodeId().getType() + ").edgeName(users).nodeType(TARGET)";
  assertEquals( output, expected );
  //now parse it
  final CandidateResult parsedId = parseIndexDocId( output );
  assertEquals(version, parsedId.getVersion());
  assertEquals(id, parsedId.getId());
  final UUID appId = parseAppIdFromIndexDocId(output);
  assertEquals(appId,applicationScope.getApplication().getUuid());
}
origin: apache/usergrid

final SearchEdge searchEdge = candidate.getSearchEdge();
final Id candidateId = candidateResult.getId();
final UUID candidateVersion = candidateResult.getVersion();
origin: apache/usergrid

@Test
public void testDocumentIdPipes() {
  final ApplicationScopeImpl applicationScope = new ApplicationScopeImpl( new SimpleId( "application" ) );
  final Id id = new SimpleId( "id" );
  final UUID version = UUIDGenerator.newTimeUUID();
  final SearchEdgeImpl searchEdge =
    new SearchEdgeImpl( new SimpleId( "source" ), "zzzcollzzz|users", SearchEdge.NodeType.TARGET );
  final String output = IndexingUtils.createIndexDocId( applicationScope, id, version, searchEdge );
  final String expected =
    "appId(" + applicationScope.getApplication().getUuid() + ",application).entityId(" + id.getUuid() + "," + id
      .getType() + ").version(" + version + ").nodeId(" + searchEdge.getNodeId().getUuid() + "," + searchEdge
      .getNodeId().getType() + ").edgeName(zzzcollzzz|users).nodeType(TARGET)";
  assertEquals( output, expected );
  //now parse it
  final CandidateResult parsedId = parseIndexDocId( output );
  assertEquals(version, parsedId.getVersion());
  assertEquals(id, parsedId.getId());
}
org.apache.usergrid.persistence.indexCandidateResultgetVersion

Popular methods of CandidateResult

  • getId
  • <init>
  • getDocId

Popular classes and methods

  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Runner (org.openjdk.jmh.runner)
    Runner executes JMH benchmarks.This is the entry point for JMH Java API. Runner is not usually reu

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)