Examples of balance()


Examples of org.apache.accumulo.server.master.balancer.SimpleLoggerBalancer.balance()

    SimpleLoggerBalancer balancer = new SimpleLoggerBalancer(0);
    List<String> loggers = Arrays.asList("logger1", "logger2", "logger3", "logger4");
    LoggerUser[] tservers = {new TabletServer("tserv1", "logger1", "logger2"), new TabletServer("tserv2", "logger1", "logger2"),
        new TabletServer("tserv3", "logger1", "logger2")};
    Map<LoggerUser,List<String>> assignmentsOut = new HashMap<LoggerUser,List<String>>();
    balancer.balance(Arrays.asList(tservers), loggers, assignmentsOut, 2);
    Map<String,Integer> computeUses = computeUses(tservers, assignmentsOut, 2);
    assertTrue(computeUses.get("logger1") <= 2);
    assertTrue(computeUses.get("logger2") <= 2);
    assertTrue(computeUses.get("logger3") <= 2);
    assertTrue(computeUses.get("logger4") <= 2);
View Full Code Here

Examples of org.apache.accumulo.server.master.balancer.SimpleLoggerBalancer.balance()

    LoggerUser[] tservers = new LoggerUser[MANY];
    for (int i = 0; i < MANY; i++) {
      tservers[i] = new TabletServer(String.format("tserv%s", i), "logger0", "logger1");
    }
    Map<LoggerUser,List<String>> assignmentsOut = new HashMap<LoggerUser,List<String>>();
    balancer.balance(Arrays.asList(tservers), loggers, assignmentsOut, 2);
    Map<String,Integer> computeUses = computeUses(tservers, assignmentsOut, 2);
    for (String logger : loggers) {
      assertTrue(computeUses.get(logger) == 2);
    }
  }
View Full Code Here

Examples of org.apache.flex.compiler.internal.parsing.mxml.BalancingMXMLProcessor.balance()

            }
        }
        this.units = units.toArray(new IMXMLUnitData[0]);
        if (fullContent && shouldRepair)
        {
            this.units = processor.balance(this.units, this, nsMap);
            if (processor.wasRepaired())
            { //repaired, so let's rebuild our prefix maps and tag depths
                refreshPositionData();
            }
        }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.HMaster.balance()

    }
    //Make sure no regions are in transition now
    waitForRITtoBeZero(master);
    // now trigger a balance
    master.balanceSwitch(true);
    boolean balanceRun = master.balance();
    assertTrue("Coprocessor should be called on region rebalancing",
        cp.wasBalanceCalled());
  }

  @Test
View Full Code Here

Examples of org.apache.hadoop.hbase.master.HMaster.balance()

    }
    //Make sure no regions are in transition now
    waitForRITtoBeZero(master);
    // now trigger a balance
    master.balanceSwitch(true);
    boolean balanceRun = master.balance();
    assertTrue("Coprocessor should be called on region rebalancing",
        cp.wasBalanceCalled());
  }

  @Test
View Full Code Here

Examples of org.apache.hadoop.hbase.master.HMaster.balance()

    }
    //Make sure no regions are in transition now
    waitForRITtoBeZero(master);
    // now trigger a balance
    master.balanceSwitch(true);
    boolean balanceRun = master.balance();
    assertTrue("Coprocessor should be called on region rebalancing",
        cp.wasBalanceCalled());
  }

  private void waitForRITtoBeZero(HMaster master) throws IOException {
View Full Code Here

Examples of org.apache.hadoop.hbase.master.HMaster.balance()

      mgr.waitOnRegionToClearRegionsInTransition(state.getRegion());
    }

    // now trigger a balance
    master.balanceSwitch(true);
    boolean balanceRun = master.balance();
    assertTrue("Coprocessor should be called on region rebalancing",
        cp.wasBalanceCalled());
    table.close();
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.HMaster.balance()

      mgr.waitOnRegionToClearRegionsInTransition(state.getRegion());
    }

    // now trigger a balance
    master.balanceSwitch(true);
    boolean balanceRun = master.balance();
    assertTrue("Coprocessor should be called on region rebalancing",
        cp.wasBalanceCalled());
  }
}
View Full Code Here

Examples of org.apache.hadoop.hbase.master.HMaster.balance()

      }
      //Make sure no regions are in transition now
      waitForRITtoBeZero(master);
      // now trigger a balance
      master.balanceSwitch(true);
      boolean balanceRun = master.balance();
      assertTrue("Coprocessor should be called on region rebalancing",
          cp.wasBalanceCalled());
    } finally {
      UTIL.deleteTable(TEST_TABLE);
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.master.HMaster.balance()

    }
    //Make sure no regions are in transition now
    waitForRITtoBeZero(master);
    // now trigger a balance
    master.balanceSwitch(true);
    boolean balanceRun = master.balance();
    assertTrue("Coprocessor should be called on region rebalancing",
        cp.wasBalanceCalled());
  }

  @Test
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.