Examples of runJoSqlQuery()


Examples of com.linkedin.helix.josql.ClusterJosqlQueryProcessor.runJoSqlQuery()

    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

Examples of com.linkedin.helix.josql.ClusterJosqlQueryProcessor.runJoSqlQuery()

    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

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

    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

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

        "WHERE getMapFieldValue( getZNRecordFromMap(:IDEALSTATES , 'TestDB'), :partitionName, :_currObj.id)='MASTER'";
    Map<String, Object> bindVariables = new HashMap<String, Object>();
    bindVariables.put("partitionName", "TestDB_2");
   
    ClusterJosqlQueryProcessor p = new ClusterJosqlQueryProcessor(manager);
    List<Object> result = p.runJoSqlQuery(SQL, bindVariables, null);
   
    Assert.assertEquals(result.size(), 1);
    List<Object> firstList = (List<Object>) result.get(0);
    Assert.assertTrue(((String)(firstList.get(0))).equalsIgnoreCase("localhost_12921"));
   
View Full Code Here

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

    SQL = "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)
    {
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)
    {
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"));
View Full Code Here

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

            + "WHERE getMapFieldValue( getZNRecordFromMap(:IDEALSTATES , 'TestDB'), :partitionName, :_currObj.id)='MASTER'";
    Map<String, Object> bindVariables = new HashMap<String, Object>();
    bindVariables.put("partitionName", "TestDB_2");

    ClusterJosqlQueryProcessor p = new ClusterJosqlQueryProcessor(manager);
    List<Object> result = p.runJoSqlQuery(SQL, bindVariables, null);

    Assert.assertEquals(result.size(), 1);
    List<Object> firstList = (List<Object>) result.get(0);
    Assert.assertTrue(((String) (firstList.get(0))).equalsIgnoreCase("localhost_12921"));
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.