Tabnine Logo
HollowCombiner.combine
Code IndexAdd Tabnine to your IDE (free)

How to use
combine
method
in
com.netflix.hollow.tools.combine.HollowCombiner

Best Java code snippets using com.netflix.hollow.tools.combine.HollowCombiner.combine (Showing top 10 results out of 315)

origin: Netflix/hollow

public HollowWriteStateEngine patch() {
  Map<String, BitSet> baseMatches = findMatches(base);
  TransitiveSetTraverser.addTransitiveMatches(base, baseMatches);
  TransitiveSetTraverser.removeReferencedOutsideClosure(base, baseMatches);
  Map<String, BitSet> patchFromMatches = findMatches(patchFrom);
  HollowCombinerCopyDirector combineDirector = new HollowPatcherCombinerCopyDirector(base, baseMatches, patchFrom, patchFromMatches);
  HollowCombiner combiner = new HollowCombiner(combineDirector, base, patchFrom);
  combiner.addIgnoredTypes(ignoredTypes);
  combiner.combine();
  return combiner.getCombinedStateEngine();
}
origin: Netflix/hollow

@Test
public void testExplicitlyExcludedButOtherwiseReferencedKeys() throws IOException {
  HollowPrimaryKeyIndex cIdx3 = new HollowPrimaryKeyIndex(input3, "TypeC", "key");
  HollowCombinerExcludePrimaryKeysCopyDirector director = new HollowCombinerExcludePrimaryKeysCopyDirector();
  director.excludeKey(cIdx3, 8);
  
  HollowCombiner combiner = new HollowCombiner(director, input1, input2, input3);
  combiner.setPrimaryKeys(new PrimaryKey("TypeB", "key", "c.key"), new PrimaryKey("TypeC", "key"));
  
  combiner.combine();
  
  HollowReadStateEngine output = StateEngineRoundTripper.roundTripSnapshot(combiner.getCombinedStateEngine());
  assertObject(output, 9, 3, 8, 3, 8, 3);
}

origin: Netflix/hollow

@Test
public void multipleTypes() throws IOException {
  HollowWriteStateEngine combineInto = new HollowWriteStateEngine();
  HollowObjectMapper mapper = new HollowObjectMapper(combineInto);
  mapper.initializeTypeState(TypeA.class);
  mapper.initializeTypeState(TypeB.class);
  
  HollowWriteStateEngine combineFromWriteEngine1 = new HollowWriteStateEngine();
  mapper = new HollowObjectMapper(combineFromWriteEngine1);
  mapper.add(new TypeB(1));
  HollowReadStateEngine combineFrom1 = StateEngineRoundTripper.roundTripSnapshot(combineFromWriteEngine1);
  HollowWriteStateEngine combineFromWriteEngine2 = new HollowWriteStateEngine();
  mapper = new HollowObjectMapper(combineFromWriteEngine2);
  mapper.add(new TypeB(2));
  mapper.add(new TypeA(2));
  HollowReadStateEngine combineFrom2 = StateEngineRoundTripper.roundTripSnapshot(combineFromWriteEngine2);
  HollowCombiner combiner = new HollowCombiner(combineInto, combineFrom1, combineFrom2);
  combiner.combine();
  
  HollowReadStateEngine combined = StateEngineRoundTripper.roundTripSnapshot(combineInto);
  assertEquals(2, combined.getTypeState("TypeB").getPopulatedOrdinals().cardinality());
  assertEquals(1, combined.getTypeState("TypeA").getPopulatedOrdinals().cardinality());
}

origin: Netflix/hollow

@Test
public void combinesEvenIfReferencedTypesAreFiltered() throws IOException {
  HollowWriteStateEngine writeEngine = new HollowWriteStateEngine();
  HollowObjectMapper mapper = new HollowObjectMapper(writeEngine);
  
  mapper.add(new TypeA(1, 1));
  mapper.add(new TypeA(2, 2));
  mapper.add(new TypeA(3, 3));
  
  HollowReadStateEngine readEngine = new HollowReadStateEngine();
  HollowFilterConfig filter = new HollowFilterConfig(true);
  filter.addType("TypeB");
  
  StateEngineRoundTripper.roundTripSnapshot(writeEngine, readEngine, filter);
  
  HollowCombiner combiner = new HollowCombiner(readEngine);
  combiner.combine();
  
  HollowWriteStateEngine combined = combiner.getCombinedStateEngine();
  
  HollowReadStateEngine combinedReadStateEngine = StateEngineRoundTripper.roundTripSnapshot(combined);
  
  HollowTypeReadState typeState = combinedReadStateEngine.getTypeState("TypeA");
  Assert.assertEquals(3, typeState.getPopulatedOrdinals().cardinality());
  
  Assert.assertNull(combinedReadStateEngine.getTypeState("TypeB"));
}

origin: Netflix/hollow

@Test
public void testCompoundKeys() throws IOException {
  HollowCombiner combiner = new HollowCombiner(input1, input2, input3);
  combiner.setPrimaryKeys(new PrimaryKey("TypeB", "key", "c.key"));
  
  combiner.combine();
  
  HollowReadStateEngine output = StateEngineRoundTripper.roundTripSnapshot(combiner.getCombinedStateEngine());
  
  assertObject(output, 1, 1, 1, 1, 1, 1);
  assertObject(output, 2, 1, 2, 1, 2, 1);
  assertObject(output, 3, 1, 3, 1, 3, 1);
  assertObject(output, 4, 2, 2, 2, 3, 2);
  assertObject(output, 5, 2, 4, 2, 4, 2);
  assertObject(output, 6, 2, 6, 2, 6, 2);
  assertObject(output, 7, 3, 2, 2, 3, 2);
  assertObject(output, 8, 3, 7, 3, 6, 3);
  assertObject(output, 9, 3, 8, 3, 8, 3);
  assertObject(output, 10,3, 4, 3, 10,3);
}

origin: Netflix/hollow

@Test
public void testCompoundCascadingKeys() throws IOException {
  HollowCombiner combiner = new HollowCombiner(input1, input2, input3);
  combiner.setPrimaryKeys(new PrimaryKey("TypeB", "key", "c.key"), new PrimaryKey("TypeC", "key"));
  
  combiner.combine();
  
  HollowReadStateEngine output = StateEngineRoundTripper.roundTripSnapshot(combiner.getCombinedStateEngine());
  
  assertObject(output, 1, 1, 1, 1, 1, 1);
  assertObject(output, 2, 1, 2, 1, 2, 1);
  assertObject(output, 3, 1, 3, 1, 3, 1);
  assertObject(output, 4, 2, 2, 2, 3, 1);
  assertObject(output, 5, 2, 4, 2, 4, 2);
  assertObject(output, 6, 2, 6, 2, 6, 2);
  assertObject(output, 7, 3, 2, 2, 3, 1);
  assertObject(output, 8, 3, 7, 3, 6, 2);
  assertObject(output, 9, 3, 8, 3, 8, 3);
  assertObject(output, 10,3, 4, 3, 10,3);
}

origin: Netflix/hollow

@Test
public void testCascadingKeys() throws IOException {
  HollowCombiner combiner = new HollowCombiner(input1, input2, input3);
  combiner.setPrimaryKeys(new PrimaryKey("TypeB", "key"), new PrimaryKey("TypeC", "key"));
  
  combiner.combine();
  
  HollowReadStateEngine output = StateEngineRoundTripper.roundTripSnapshot(combiner.getCombinedStateEngine());
  
  assertObject(output, 1, 1, 1, 1, 1, 1);
  assertObject(output, 2, 1, 2, 1, 2, 1);
  assertObject(output, 3, 1, 3, 1, 3, 1);
  assertObject(output, 4, 2, 2, 1, 2, 1);
  assertObject(output, 5, 2, 4, 2, 4, 2);
  assertObject(output, 6, 2, 6, 2, 6, 2);
  assertObject(output, 7, 3, 2, 1, 2, 1);
  assertObject(output, 8, 3, 7, 3, 6, 2);
  assertObject(output, 9, 3, 8, 3, 8, 3);
  assertObject(output, 10,3, 4, 2, 4, 2);
}

origin: Netflix/hollow

@Test
public void testExcludeReferencedObjectsFromPrimaryKeyCopyDirector() throws IOException {
  HollowPrimaryKeyIndex aIdx3 = new HollowPrimaryKeyIndex(input3, "TypeA", "key");
  HollowCombinerExcludePrimaryKeysCopyDirector director = new HollowCombinerExcludePrimaryKeysCopyDirector();
  director.excludeKey(aIdx3, 9);
  HollowCombiner combiner = new HollowCombiner(director, input1, input2, input3);
  combiner.setPrimaryKeys(new PrimaryKey("TypeB", "key", "c.key"), new PrimaryKey("TypeC", "key"));
  combiner.combine();
  HollowReadStateEngine output = StateEngineRoundTripper.roundTripSnapshot(combiner.getCombinedStateEngine());
  
  Assert.assertEquals(-1, new HollowPrimaryKeyIndex(output, "TypeA", "key").getMatchingOrdinal(9));
  Assert.assertNotEquals(-1, new HollowPrimaryKeyIndex(output, "TypeB", "key").getMatchingOrdinal(8));
  Assert.assertNotEquals(-1, new HollowPrimaryKeyIndex(output, "TypeC", "key").getMatchingOrdinal(8));
  
  director.excludeReferencedObjects();
  
  combiner = new HollowCombiner(director, input1, input2, input3);
  combiner.setPrimaryKeys(new PrimaryKey("TypeB", "key", "c.key"), new PrimaryKey("TypeC", "key"));
  combiner.combine();
  output = StateEngineRoundTripper.roundTripSnapshot(combiner.getCombinedStateEngine());
  
  Assert.assertEquals(-1, new HollowPrimaryKeyIndex(output, "TypeA", "key").getMatchingOrdinal(9));
  Assert.assertEquals(-1, new HollowPrimaryKeyIndex(output, "TypeB", "key").getMatchingOrdinal(8));
  Assert.assertEquals(-1, new HollowPrimaryKeyIndex(output, "TypeC", "key").getMatchingOrdinal(8));
}

origin: Netflix/hollow

@Test
public void testExplicitlyExcludedAndRemappedKeys() throws IOException {
  HollowPrimaryKeyIndex cIdx1 = new HollowPrimaryKeyIndex(input1, "TypeC", "key");
  HollowCombinerExcludePrimaryKeysCopyDirector director = new HollowCombinerExcludePrimaryKeysCopyDirector();
  director.excludeKey(cIdx1, 3);
  
  HollowCombiner combiner = new HollowCombiner(director, input1, input2, input3);
  combiner.setPrimaryKeys(new PrimaryKey("TypeB", "key", "c.key"), new PrimaryKey("TypeC", "key"));
  
  combiner.combine();
  
  HollowReadStateEngine output = StateEngineRoundTripper.roundTripSnapshot(combiner.getCombinedStateEngine());
  assertObject(output, 1, 1, 1, 1, 1, 1);
  assertObject(output, 2, 1, 2, 1, 2, 1);
  assertObject(output, 3, 1, 3, 1, 3, 2);
  assertObject(output, 4, 2, 2, 2, 3, 2);
  assertObject(output, 5, 2, 4, 2, 4, 2);
  assertObject(output, 6, 2, 6, 2, 6, 2);
  assertObject(output, 7, 3, 2, 2, 3, 2);
  assertObject(output, 8, 3, 7, 3, 6, 2);
  assertObject(output, 9, 3, 8, 3, 8, 3);
  assertObject(output, 10,3, 4, 3, 10,3);
}

origin: Netflix/hollow

@Test
public void testCombiner() throws IOException {
  addRecord(shard1, 1, "C1", "C2", "C3");
  addRecord(shard1, 2, "C2", "C3", "C4");
  addRecord(shard1, 3, "C1", "C2", "C3");
  addRecord(shard2, 4, "C2", "C3", "C4");
  addRecord(shard2, 5, "C1", "C4", "C5");
  addRecord(shard2, 6, "C1", "C2", "C3");
  addRecord(shard3, 7, "C4", "C5", "C6");
  HollowCombiner combiner = new HollowCombiner(roundTrip(shard1), roundTrip(shard2), roundTrip(shard3));
  combiner.combine();
  HollowReadStateEngine combinedResult = roundTrip(combiner.getCombinedStateEngine());
  Assert.assertEquals(6, combinedResult.getTypeState("A").maxOrdinal());
  Assert.assertEquals(3, combinedResult.getTypeState("B").maxOrdinal());
  Assert.assertEquals(5, combinedResult.getTypeState("C").maxOrdinal());
  HollowSetTypeReadState bTypeState = (HollowSetTypeReadState)combinedResult.getTypeState("B");
  Assert.assertTrue(setOrderingExists(bTypeState, "C1", "C2", "C3"));
  Assert.assertTrue(setOrderingExists(bTypeState, "C2", "C3", "C4"));
  Assert.assertTrue(setOrderingExists(bTypeState, "C1", "C4", "C5"));
  Assert.assertTrue(setOrderingExists(bTypeState, "C4", "C5", "C6"));
}
com.netflix.hollow.tools.combineHollowCombinercombine

Javadoc

Perform the combine operation.

Popular methods of HollowCombiner

  • <init>
  • getCombinedStateEngine
  • addIgnoredTypes
    Specify a set of types not to copy. Be careful: if any included types reference any of the specified
  • copyOrdinal
  • createHashOrderIndependentOrdinalMaps
  • createOrdinalRemappers
  • getAllTypesWithDefinedHashCodes
  • getPrimaryKeys
  • initializePrimaryKeys
  • isAnySelectedPrimaryKeyADependencyOf
  • isAnySelectedPrimaryKeyDependentOn
  • isDefinedHashCode
  • isAnySelectedPrimaryKeyDependentOn,
  • isDefinedHashCode,
  • setPrimaryKeys,
  • sortPrimaryKeys

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JTextField (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now