Examples of runJoSqlQuery()


Examples of org.apache.helix.josql.ClusterJosqlQueryProcessor.runJoSqlQuery()

        "SELECT id  "
            + "FROM LIVEINSTANCES "
            + "WHERE hasMapFieldKey( getZNRecordFromMap(:IDEALSTATES, 'TestDB'), :partitionName, :_currObj.id)='true'";
    p = new ClusterJosqlQueryProcessor(manager);
    bindVariables.put("partitionName", "TestDB_10");
    result = p.runJoSqlQuery(SQL, bindVariables, null);

    Assert.assertEquals(result.size(), 3);
    Set<String> hosts = new HashSet<String>();
    for (Object o : result) {
      String val = (String) ((List<Object>) o).get(0);
View Full Code Here

Examples of org.apache.helix.josql.ClusterJosqlQueryProcessor.runJoSqlQuery()

            + "FROM PARTITIONS "
            + "WHERE getMapFieldValue( getZNRecordFromMap(:EXTERNALVIEW, 'TestDB'), id, :instanceName)='MASTER'";
    p = new ClusterJosqlQueryProcessor(manager);
    bindVariables.clear();
    bindVariables.put("instanceName", "localhost_12919");
    result = p.runJoSqlQuery(SQL, bindVariables, null);

    Assert.assertEquals(result.size(), 4);
    Set<String> partitions = new HashSet<String>();
    for (Object o : result) {
      String val = (String) ((List<Object>) o).get(0);
View Full Code Here

Examples of org.apache.helix.josql.ClusterJosqlQueryProcessor.runJoSqlQuery()

    bindVariables.clear();
    bindVariables.put("instanceName", "localhost_12919");
    bindVariables.put("mapFieldKey", "CURRENT_STATE");
    bindVariables.put("partitionState", "MASTER");

    result = p.runJoSqlQuery(SQL, bindVariables, null);

    Assert.assertEquals(result.size(), 4);
    partitions.clear();
    partitions = new HashSet<String>();
    for (Object o : result) {
View Full Code Here

Examples of org.apache.helix.josql.ClusterJosqlQueryProcessor.runJoSqlQuery()

    bindVariables.clear();
    bindVariables.put("partitionName", "TestDB_8");
    bindVariables.put("mapFieldKey", "CURRENT_STATE");
    bindVariables.put("partitionState", "SLAVE");

    result = p.runJoSqlQuery(SQL, bindVariables, null);

    Assert.assertEquals(result.size(), 2);
    partitions.clear();
    partitions = new HashSet<String>();
    for (Object o : result) {
View Full Code Here

Examples of org.apache.helix.josql.ClusterJosqlQueryProcessor.runJoSqlQuery()

            + " AND mapValue LIKE 'SLAVE' "
            + " AND mapSubKey IN ((SELECT [*]id FROM :LIVEINSTANCES)) "
            + " ORDER BY parseInt(getMapFieldValue(getZNRecordFromMap(:scnMap, mapSubKey), 'SCN', mapKey))";

    ClusterJosqlQueryProcessor p = new ClusterJosqlQueryProcessor(manager);
    List<Object> result = p.runJoSqlQuery(SQL, bindVariables, null);
    int prevSCN = -1;
    for (Object row : result) {
      List<String> stringRow = (List<String>) row;
      Assert.assertTrue(stringRow.get(1).equals("SLAVE"));
      int scn = Integer.parseInt(stringRow.get(2));
View Full Code Here

Examples of org.apache.helix.josql.ClusterJosqlQueryProcessor.runJoSqlQuery()

        "SELECT DISTINCT " + queryFields + " FROM " + queryTarget + " WHERE " + matchCondition;
    ClusterJosqlQueryProcessor p = new ClusterJosqlQueryProcessor(manager);
    List<Object> result = new ArrayList<Object>();
    try {
      logger.info("JOSQL query: " + josql);
      result = p.runJoSqlQuery(josql, null, null);
    } catch (Exception e) {
      logger.error("", e);
      return selected;
    }
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.