Examples of PerRegionIndexWriteCache


Examples of com.salesforce.hbase.index.write.recovery.PerRegionIndexWriteCache

    }
  };

  @Test
  public void testAddRemoveSingleRegion() {
    PerRegionIndexWriteCache cache = new PerRegionIndexWriteCache();
    HTableInterfaceReference t1 = new HTableInterfaceReference(new ImmutableBytesPtr(Bytes.toBytes("t1")));
    List<Mutation> mutations = new ArrayList<Mutation>();
    mutations.add(p);
    cache.addEdits(r1, t1, mutations);
    Multimap<HTableInterfaceReference, Mutation> edits = cache.getEdits(r1);
    Set<Entry<HTableInterfaceReference, Collection<Mutation>>> entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
     //ensure that we are still storing a list here - otherwise it breaks the parallel writer implementation
      final List<Mutation> stored = (List<Mutation>) entry.getValue();
      assertEquals("Got an unexpected amount of mutations in the entry", 1, stored.size());
      assertEquals("Got an unexpected mutation in the entry", p, stored.get(0));
    }

    // ensure that a second get doesn't have any more edits. This ensures that we don't keep
    // references around to these edits and have a memory leak
    assertNull("Got an entry for a region we removed", cache.getEdits(r1));
  }
View Full Code Here

Examples of com.salesforce.hbase.index.write.recovery.PerRegionIndexWriteCache

    assertNull("Got an entry for a region we removed", cache.getEdits(r1));
  }

  @Test
  public void testMultipleAddsForSingleRegion() {
    PerRegionIndexWriteCache cache = new PerRegionIndexWriteCache();
    HTableInterfaceReference t1 =
        new HTableInterfaceReference(new ImmutableBytesPtr(Bytes.toBytes("t1")));
    List<Mutation> mutations = Lists.<Mutation> newArrayList(p);
    cache.addEdits(r1, t1, mutations);

    // add a second set
    mutations = Lists.<Mutation> newArrayList(p2);
    cache.addEdits(r1, t1, mutations);

    Multimap<HTableInterfaceReference, Mutation> edits = cache.getEdits(r1);
    Set<Entry<HTableInterfaceReference, Collection<Mutation>>> entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
      // ensure that we are still storing a list here - otherwise it breaks the parallel writer
      // implementation
View Full Code Here

Examples of com.salesforce.hbase.index.write.recovery.PerRegionIndexWriteCache

    }
  }

  @Test
  public void testMultipleRegions() {
    PerRegionIndexWriteCache cache = new PerRegionIndexWriteCache();
    HTableInterfaceReference t1 =
        new HTableInterfaceReference(new ImmutableBytesPtr(Bytes.toBytes("t1")));
    List<Mutation> mutations = Lists.<Mutation> newArrayList(p);
    List<Mutation> m2 = Lists.<Mutation> newArrayList(p2);
    // add each region
    cache.addEdits(r1, t1, mutations);
    cache.addEdits(r2, t1, m2);

    // check region1
    Multimap<HTableInterfaceReference, Mutation> edits = cache.getEdits(r1);
    Set<Entry<HTableInterfaceReference, Collection<Mutation>>> entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
      // ensure that we are still storing a list here - otherwise it breaks the parallel writer
      // implementation
      final List<Mutation> stored = (List<Mutation>) entry.getValue();
      assertEquals("Got an unexpected amount of mutations in the entry for region1", 1,
        stored.size());
      assertEquals("Got an unexpected mutation in the entry for region2", p, stored.get(0));
    }

    // check region2
    edits = cache.getEdits(r2);
    entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
      // ensure that we are still storing a list here - otherwise it breaks the parallel writer
      // implementation
      final List<Mutation> stored = (List<Mutation>) entry.getValue();
      assertEquals("Got an unexpected amount of mutations in the entry for region2", 1,
        stored.size());
      assertEquals("Got an unexpected mutation in the entry for region2", p2, stored.get(0));
    }


    // ensure that a second get doesn't have any more edits. This ensures that we don't keep
    // references around to these edits and have a memory leak
    assertNull("Got an entry for a region we removed", cache.getEdits(r1));
  }
View Full Code Here

Examples of org.apache.hbase.index.write.recovery.PerRegionIndexWriteCache

    }
  };

  @Test
  public void testAddRemoveSingleRegion() {
    PerRegionIndexWriteCache cache = new PerRegionIndexWriteCache();
    HTableInterfaceReference t1 = new HTableInterfaceReference(new ImmutableBytesPtr(Bytes.toBytes("t1")));
    List<Mutation> mutations = new ArrayList<Mutation>();
    mutations.add(p);
    cache.addEdits(r1, t1, mutations);
    Multimap<HTableInterfaceReference, Mutation> edits = cache.getEdits(r1);
    Set<Entry<HTableInterfaceReference, Collection<Mutation>>> entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
     //ensure that we are still storing a list here - otherwise it breaks the parallel writer implementation
      final List<Mutation> stored = (List<Mutation>) entry.getValue();
      assertEquals("Got an unexpected amount of mutations in the entry", 1, stored.size());
      assertEquals("Got an unexpected mutation in the entry", p, stored.get(0));
    }

    // ensure that a second get doesn't have any more edits. This ensures that we don't keep
    // references around to these edits and have a memory leak
    assertNull("Got an entry for a region we removed", cache.getEdits(r1));
  }
View Full Code Here

Examples of org.apache.hbase.index.write.recovery.PerRegionIndexWriteCache

    assertNull("Got an entry for a region we removed", cache.getEdits(r1));
  }

  @Test
  public void testMultipleAddsForSingleRegion() {
    PerRegionIndexWriteCache cache = new PerRegionIndexWriteCache();
    HTableInterfaceReference t1 =
        new HTableInterfaceReference(new ImmutableBytesPtr(Bytes.toBytes("t1")));
    List<Mutation> mutations = Lists.<Mutation> newArrayList(p);
    cache.addEdits(r1, t1, mutations);

    // add a second set
    mutations = Lists.<Mutation> newArrayList(p2);
    cache.addEdits(r1, t1, mutations);

    Multimap<HTableInterfaceReference, Mutation> edits = cache.getEdits(r1);
    Set<Entry<HTableInterfaceReference, Collection<Mutation>>> entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
      // ensure that we are still storing a list here - otherwise it breaks the parallel writer
      // implementation
View Full Code Here

Examples of org.apache.hbase.index.write.recovery.PerRegionIndexWriteCache

    }
  }

  @Test
  public void testMultipleRegions() {
    PerRegionIndexWriteCache cache = new PerRegionIndexWriteCache();
    HTableInterfaceReference t1 =
        new HTableInterfaceReference(new ImmutableBytesPtr(Bytes.toBytes("t1")));
    List<Mutation> mutations = Lists.<Mutation> newArrayList(p);
    List<Mutation> m2 = Lists.<Mutation> newArrayList(p2);
    // add each region
    cache.addEdits(r1, t1, mutations);
    cache.addEdits(r2, t1, m2);

    // check region1
    Multimap<HTableInterfaceReference, Mutation> edits = cache.getEdits(r1);
    Set<Entry<HTableInterfaceReference, Collection<Mutation>>> entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
      // ensure that we are still storing a list here - otherwise it breaks the parallel writer
      // implementation
      final List<Mutation> stored = (List<Mutation>) entry.getValue();
      assertEquals("Got an unexpected amount of mutations in the entry for region1", 1,
        stored.size());
      assertEquals("Got an unexpected mutation in the entry for region2", p, stored.get(0));
    }

    // check region2
    edits = cache.getEdits(r2);
    entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
      // ensure that we are still storing a list here - otherwise it breaks the parallel writer
      // implementation
      final List<Mutation> stored = (List<Mutation>) entry.getValue();
      assertEquals("Got an unexpected amount of mutations in the entry for region2", 1,
        stored.size());
      assertEquals("Got an unexpected mutation in the entry for region2", p2, stored.get(0));
    }


    // ensure that a second get doesn't have any more edits. This ensures that we don't keep
    // references around to these edits and have a memory leak
    assertNull("Got an entry for a region we removed", cache.getEdits(r1));
  }
View Full Code Here

Examples of org.apache.phoenix.hbase.index.write.recovery.PerRegionIndexWriteCache

    }
  };

  @Test
  public void testAddRemoveSingleRegion() {
    PerRegionIndexWriteCache cache = new PerRegionIndexWriteCache();
    HTableInterfaceReference t1 = new HTableInterfaceReference(new ImmutableBytesPtr(Bytes.toBytes("t1")));
    List<Mutation> mutations = new ArrayList<Mutation>();
    mutations.add(p);
    cache.addEdits(r1, t1, mutations);
    Multimap<HTableInterfaceReference, Mutation> edits = cache.getEdits(r1);
    Set<Entry<HTableInterfaceReference, Collection<Mutation>>> entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
     //ensure that we are still storing a list here - otherwise it breaks the parallel writer implementation
      final List<Mutation> stored = (List<Mutation>) entry.getValue();
      assertEquals("Got an unexpected amount of mutations in the entry", 1, stored.size());
      assertEquals("Got an unexpected mutation in the entry", p, stored.get(0));
    }

    // ensure that a second get doesn't have any more edits. This ensures that we don't keep
    // references around to these edits and have a memory leak
    assertNull("Got an entry for a region we removed", cache.getEdits(r1));
  }
View Full Code Here

Examples of org.apache.phoenix.hbase.index.write.recovery.PerRegionIndexWriteCache

    assertNull("Got an entry for a region we removed", cache.getEdits(r1));
  }

  @Test
  public void testMultipleAddsForSingleRegion() {
    PerRegionIndexWriteCache cache = new PerRegionIndexWriteCache();
    HTableInterfaceReference t1 =
        new HTableInterfaceReference(new ImmutableBytesPtr(Bytes.toBytes("t1")));
    List<Mutation> mutations = Lists.<Mutation> newArrayList(p);
    cache.addEdits(r1, t1, mutations);

    // add a second set
    mutations = Lists.<Mutation> newArrayList(p2);
    cache.addEdits(r1, t1, mutations);

    Multimap<HTableInterfaceReference, Mutation> edits = cache.getEdits(r1);
    Set<Entry<HTableInterfaceReference, Collection<Mutation>>> entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
      // ensure that we are still storing a list here - otherwise it breaks the parallel writer
      // implementation
View Full Code Here

Examples of org.apache.phoenix.hbase.index.write.recovery.PerRegionIndexWriteCache

    }
  }

  @Test
  public void testMultipleRegions() {
    PerRegionIndexWriteCache cache = new PerRegionIndexWriteCache();
    HTableInterfaceReference t1 =
        new HTableInterfaceReference(new ImmutableBytesPtr(Bytes.toBytes("t1")));
    List<Mutation> mutations = Lists.<Mutation> newArrayList(p);
    List<Mutation> m2 = Lists.<Mutation> newArrayList(p2);
    // add each region
    cache.addEdits(r1, t1, mutations);
    cache.addEdits(r2, t1, m2);

    // check region1
    Multimap<HTableInterfaceReference, Mutation> edits = cache.getEdits(r1);
    Set<Entry<HTableInterfaceReference, Collection<Mutation>>> entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
      // ensure that we are still storing a list here - otherwise it breaks the parallel writer
      // implementation
      final List<Mutation> stored = (List<Mutation>) entry.getValue();
      assertEquals("Got an unexpected amount of mutations in the entry for region1", 1,
        stored.size());
      assertEquals("Got an unexpected mutation in the entry for region2", p, stored.get(0));
    }

    // check region2
    edits = cache.getEdits(r2);
    entries = edits.asMap().entrySet();
    assertEquals("Got more than one table in the the edit map!", 1, entries.size());
    for (Entry<HTableInterfaceReference, Collection<Mutation>> entry : entries) {
      // ensure that we are still storing a list here - otherwise it breaks the parallel writer
      // implementation
      final List<Mutation> stored = (List<Mutation>) entry.getValue();
      assertEquals("Got an unexpected amount of mutations in the entry for region2", 1,
        stored.size());
      assertEquals("Got an unexpected mutation in the entry for region2", p2, stored.get(0));
    }


    // ensure that a second get doesn't have any more edits. This ensures that we don't keep
    // references around to these edits and have a memory leak
    assertNull("Got an entry for a region we removed", cache.getEdits(r1));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.