Package co.nubetech.crux.model

Examples of co.nubetech.crux.model.Report


  @Test
  public void testEditReport() throws CruxException{
   
    ReportDesignAction reportDesignAction = new ReportDesignAction();
   
    Report report = new Report();
    report.setId(100);
    //report.set
    reportDesignAction.setReport(report);
   
   
    ReportDAO mockedReportDAO = mock(ReportDAO.class);
View Full Code Here


    Mapping mapping2 = new Mapping();
    mapping2.setId(122);
    Mapping mapping3 = new Mapping();
    mapping3.setId(123);
   
    Report report = new Report();
   
    ArrayList<Mapping> mappingList = new ArrayList<Mapping>();
    mappingList.add(mapping1);
    mappingList.add(mapping2);
    mappingList.add(mapping3);
View Full Code Here

      GroupBy groupBy1 = createGroupBy(2, alias1);
      List<GroupBy> groupByList = new ArrayList<GroupBy>();
      groupByList.add(groupBy);
      groupByList.add(groupBy1);
     
      Report report = new Report();
      report.setId(99999);
     
      GroupBys groupBys = new GroupBys();
      groupBys.setGroupBy(groupByList);
      groupBys.setReport(report);
     
View Full Code Here

    scanner.close();
  }
 
  @Test
  public void testRangeScanCompositeRowRegex() throws IOException, CruxException {
      Report report = new Report();
      Mapping mapping = new Mapping();
      mapping.setTableName(TABLE_2);

      RowAlias rAlias1 = new RowAlias();
      rAlias1.setAlias("rowkeyLong");
      rAlias1.setLength(8);
      rAlias1.setId(1l);
      ValueType valueType1 = new ValueType();
      valueType1.setClassName("java.lang.Long");
      rAlias1.setValueType(valueType1);
      rAlias1.setMapping(mapping);

      RowAlias rAlias2 = new RowAlias();
      rAlias2.setAlias("rowkeyInt");
      rAlias2.setLength(4);
      rAlias2.setId(2l);
      ValueType valueType2 = new ValueType();
      valueType2.setClassName("java.lang.Integer");
      rAlias2.setValueType(valueType2);
      rAlias2.setMapping(mapping);

      RowAlias rAlias3 = new RowAlias();
      rAlias3.setAlias("rowkeyString");
      rAlias3.setId(3l);
      rAlias3.setLength((int) Bytes.toBytes("I am a String" + 11).length);
      ValueType valueType3 = new ValueType();
      valueType3.setClassName("java.lang.String");
      rAlias3.setValueType(valueType3);
      rAlias3.setMapping(mapping);
     
      //mapping.addRowAlias(rAlias3);
      //add aliases in order
      LinkedHashMap<String, RowAlias> rowMap = new LinkedHashMap<String, RowAlias>();
      rowMap.put(rAlias1.getAlias(), rAlias1);
      rowMap.put(rAlias2.getAlias(), rAlias2);
      rowMap.put(rAlias3.getAlias(), rAlias3);
      mapping.setRowAlias(rowMap);
     
      ColumnAlias cAlias = new ColumnAlias();
      cAlias.setAlias("col");
      cAlias.setColumnFamily("cf");
      cAlias.setQualifier("qualifier");
      cAlias.setValueType(valueType3);
      mapping.addColumnAlias(cAlias);

      ColumnAlias cAlias1 = new ColumnAlias();
      cAlias1.setAlias("col1");
      cAlias1.setColumnFamily("cf1");
      cAlias1.setValueType(valueType1);
      mapping.addColumnAlias(cAlias1);
     
      ColumnAlias cAlias2 = new ColumnAlias();
      cAlias2.setAlias("col2");
      cAlias2.setColumnFamily("cf");
      cAlias2.setQualifier("qualifier1");
      cAlias2.setValueType(valueType3);
      mapping.addColumnAlias(cAlias2);

      RowAliasFilter rowFilter = new RowAliasFilter();
      FilterType filter = new FilterType();
      filter.setType("Pattern Not Matches");
      rowFilter.setFilterType(filter);
      rowFilter.setRowAlias(rAlias3);
      rowFilter.setValue(".*6|.*7");

      ArrayList<RowAliasFilter> filters = new ArrayList<RowAliasFilter>();
      filters.add(rowFilter);
      report.setRowAliasFilters(filters);
     
      ReportDesign design = new ReportDesign();
      design.setColumnAlias(cAlias);
      report.addDesign(design);     
      ReportDesign design1 = new ReportDesign();
      design1.setColumnAlias(cAlias2);
      report.addDesign(design1);     
      ReportDesign design3 = new ReportDesign();
      design3.setRowAlias(rAlias1);
      report.addDesign(design3);
      ReportDesign design4 = new ReportDesign();
      design4.setRowAlias(rAlias2);
      report.addDesign(design4);
      ReportDesign design5 = new ReportDesign();
      design5.setRowAlias(rAlias3);
      report.addDesign(design5);

      HBaseFacade hbaseFacade = new HBaseFacade(pool);
      CruxScanner scanner = hbaseFacade.execute(connection, report, mapping);
      assertTrue(scanner instanceof CruxScannerResultScannerImpl);
      CruxResult scanResult = null;
View Full Code Here

  }
 
 
  @Test
  public void testRangeScanSimpleStringRowPattern() throws IOException, CruxException {
    Report report = new Report();
    Mapping mapping = new Mapping();
    mapping.setTableName(TABLE);

    RowAlias rAlias = new RowAlias();
    rAlias.setAlias("rowkey");
    rAlias.setLength(4);
    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.String");
    rAlias.setValueType(valueType);
    mapping.addRowAlias(rAlias);

    ColumnAlias cAlias = new ColumnAlias();
    cAlias.setAlias("col");
    cAlias.setColumnFamily("cf");
    mapping.addColumnAlias(cAlias);

    ColumnAlias cAlias1 = new ColumnAlias();
    cAlias1.setAlias("col1");
    cAlias1.setColumnFamily("cf1");
    mapping.addColumnAlias(cAlias1);

    RowAliasFilter rowFilter = new RowAliasFilter();
    FilterType filter1 = new FilterType();
    filter1.setType("Pattern Matches");
    rowFilter.setFilterType(filter1);
    rowFilter.setRowAlias(rAlias);
    rowFilter.setValue(".*5");

    ArrayList<RowAliasFilter> filters = new ArrayList<RowAliasFilter>();
    filters.add(rowFilter);
    report.setRowAliasFilters(filters);

    ReportDesign design = new ReportDesign();
    design.setRowAlias(rAlias);
    design.setReport(report);
    report.addDesign(design);
   
    HBaseFacade hbaseFacade = new HBaseFacade(pool);
    CruxScanner scanner = hbaseFacade.execute(connection, report, mapping);
    assertTrue(scanner instanceof CruxScannerResultScannerImpl);
    CruxResult scanResult = null;
View Full Code Here

    scanner.close();   
  }
 
  @Test
  public void testRangeScanSimpleStringRowEndsWith() throws IOException, CruxException {
    Report report = new Report();
    Mapping mapping = new Mapping();
    mapping.setTableName(TABLE);

    RowAlias rAlias = new RowAlias();
    rAlias.setAlias("rowkey");
    rAlias.setLength(4);
    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.String");
    rAlias.setValueType(valueType);
    mapping.addRowAlias(rAlias);

    ColumnAlias cAlias = new ColumnAlias();
    cAlias.setAlias("col");
    cAlias.setColumnFamily("cf");
    mapping.addColumnAlias(cAlias);

    ColumnAlias cAlias1 = new ColumnAlias();
    cAlias1.setAlias("col1");
    cAlias1.setColumnFamily("cf1");
    mapping.addColumnAlias(cAlias1);

    RowAliasFilter rowFilter = new RowAliasFilter();
    FilterType filter1 = new FilterType();
    filter1.setType("Ends With");
    rowFilter.setFilterType(filter1);
    rowFilter.setRowAlias(rAlias);
    rowFilter.setValue("5");

    ArrayList<RowAliasFilter> filters = new ArrayList<RowAliasFilter>();
    filters.add(rowFilter);
    report.setRowAliasFilters(filters);
   
    ReportDesign design = new ReportDesign();
    design.setRowAlias(rAlias);
    design.setReport(report);
    report.addDesign(design);
   
    HBaseFacade hbaseFacade = new HBaseFacade(pool);
    CruxScanner scanner = hbaseFacade.execute(connection, report, mapping);
    assertTrue(scanner instanceof CruxScannerResultScannerImpl);
    CruxResult scanResult = null;
View Full Code Here

    scanner.close();   
  }
 
  @Test
  public void testRangeScanSimpleStringRowEndsWithNoLength() throws IOException, CruxException {
    Report report = new Report();
    Mapping mapping = new Mapping();
    mapping.setTableName(TABLE);

    RowAlias rAlias = new RowAlias();
    rAlias.setAlias("rowkey");
    ValueType valueType = new ValueType();
    valueType.setClassName("java.lang.String");
    rAlias.setLength(4);
    rAlias.setValueType(valueType);
    mapping.addRowAlias(rAlias);

    ColumnAlias cAlias = new ColumnAlias();
    cAlias.setAlias("col");
    cAlias.setColumnFamily("cf");
    mapping.addColumnAlias(cAlias);

    ColumnAlias cAlias1 = new ColumnAlias();
    cAlias1.setAlias("col1");
    cAlias1.setColumnFamily("cf1");
    mapping.addColumnAlias(cAlias1);

    RowAliasFilter rowFilter = new RowAliasFilter();
    FilterType filter1 = new FilterType();
    filter1.setType("Ends With");
    rowFilter.setFilterType(filter1);
    rowFilter.setRowAlias(rAlias);
    rowFilter.setValue("5");

    ArrayList<RowAliasFilter> filters = new ArrayList<RowAliasFilter>();
    filters.add(rowFilter);
    report.setRowAliasFilters(filters);
   
    ReportDesign design = new ReportDesign();
    design.setRowAlias(rAlias);
    design.setReport(report);
    report.addDesign(design);
   
    HBaseFacade hbaseFacade = new HBaseFacade(pool);
    CruxScanner scanner = hbaseFacade.execute(connection, report, mapping);
    assertTrue(scanner instanceof CruxScannerResultScannerImpl);
    CruxResult scanResult = null;
View Full Code Here

   
  }
 
  @Test
    public void testRangeScanCompositeRowGreaterThanEq() throws IOException, CruxException {
            Report report = new Report();
            Mapping mapping = new Mapping();
            mapping.setTableName(TABLE_2);

            RowAlias rAlias1 = new RowAlias();
            rAlias1.setAlias("rowkeyLong");
            rAlias1.setLength(8);
            rAlias1.setId(1l);
            ValueType valueType1 = new ValueType();
            valueType1.setClassName("java.lang.Long");
            rAlias1.setValueType(valueType1);
            rAlias1.setMapping(mapping);

            RowAlias rAlias2 = new RowAlias();
            rAlias2.setAlias("rowkeyInt");
            rAlias2.setLength(4);
            rAlias2.setId(2l);
            ValueType valueType2 = new ValueType();
            valueType2.setClassName("java.lang.Integer");
            rAlias2.setValueType(valueType2);
            rAlias2.setMapping(mapping);

            RowAlias rAlias3 = new RowAlias();
            rAlias3.setAlias("rowkeyString");
            rAlias3.setId(3l);
            rAlias3.setLength((int) Bytes.toBytes("I am a String" + 11).length);
            ValueType valueType3 = new ValueType();
            valueType3.setClassName("java.lang.String");
            rAlias3.setValueType(valueType3);
            rAlias3.setMapping(mapping);
           
            //add aliases in order
            LinkedHashMap<String, RowAlias> rowMap = new LinkedHashMap<String, RowAlias>();
            rowMap.put(rAlias1.getAlias(), rAlias1);
            rowMap.put(rAlias2.getAlias(), rAlias2);
            rowMap.put(rAlias3.getAlias(), rAlias3);
            mapping.setRowAlias(rowMap);
           
            ColumnAlias cAlias = new ColumnAlias();
            cAlias.setAlias("col");
            cAlias.setColumnFamily("cf");
            cAlias.setQualifier("qualifier");
            cAlias.setValueType(valueType3);
            mapping.addColumnAlias(cAlias);

            ColumnAlias cAlias1 = new ColumnAlias();
            cAlias1.setAlias("col1");
            cAlias1.setColumnFamily("cf1");
            cAlias.setValueType(valueType3);
            mapping.addColumnAlias(cAlias1);
           
            ColumnAlias cAlias2 = new ColumnAlias();
            cAlias2.setAlias("col2");
            cAlias2.setColumnFamily("cf");
            cAlias2.setQualifier("qualifier1");
            cAlias2.setValueType(valueType3);
            mapping.addColumnAlias(cAlias2);

            RowAliasFilter rowFilter = new RowAliasFilter();
            FilterType filter = new FilterType();
            filter.setType("Greater Than Equals");
            rowFilter.setFilterType(filter);
            rowFilter.setRowAlias(rAlias3);
            rowFilter.setValue("I am a String17");

            ArrayList<RowAliasFilter> filters = new ArrayList<RowAliasFilter>();
            filters.add(rowFilter);
            report.setRowAliasFilters(filters);
           
      ReportDesign design = new ReportDesign();
      design.setColumnAlias(cAlias);
      report.addDesign(design);     
      ReportDesign design1 = new ReportDesign();
      design1.setColumnAlias(cAlias2);
      report.addDesign(design1);     
      ReportDesign design3 = new ReportDesign();
      design3.setRowAlias(rAlias1);
      report.addDesign(design3);
      ReportDesign design4 = new ReportDesign();
      design4.setRowAlias(rAlias2);
      report.addDesign(design4);
      ReportDesign design5 = new ReportDesign();
      design5.setRowAlias(rAlias3);
      report.addDesign(design5);

            HBaseFacade hbaseFacade = new HBaseFacade(pool);
            CruxScanner scanner = hbaseFacade.execute(connection, report, mapping);
            assertTrue(scanner instanceof CruxScannerResultScannerImpl);
            CruxResult scanResult = null;
View Full Code Here

      scanner.close();
  }
 
  @Test
    public void testRangeScanCompRowNonAgg() throws IOException, CruxException {
            Report report = new Report();
            Mapping mapping = new Mapping();
            mapping.setTableName(TABLE_2);

            RowAlias rAlias1 = new RowAlias();
            rAlias1.setAlias("rowkeyLong");
            rAlias1.setLength(8);
            rAlias1.setId(1l);
            ValueType valueType1 = new ValueType();
            valueType1.setClassName("java.lang.Long");
            rAlias1.setValueType(valueType1);
            rAlias1.setMapping(mapping);

            RowAlias rAlias2 = new RowAlias();
            rAlias2.setAlias("rowkeyInt");
            rAlias2.setLength(4);
            rAlias2.setId(2l);
            ValueType valueType2 = new ValueType();
            valueType2.setClassName("java.lang.Integer");
            rAlias2.setValueType(valueType2);
            rAlias2.setMapping(mapping);

            RowAlias rAlias3 = new RowAlias();
            rAlias3.setAlias("rowkeyString");
            rAlias3.setId(3l);
            rAlias3.setLength((int) Bytes.toBytes("I am a String" + 11).length);
            ValueType valueType3 = new ValueType();
            valueType3.setClassName("java.lang.String");
            rAlias3.setValueType(valueType3);
            rAlias3.setMapping(mapping);
           
            //add aliases in order
            LinkedHashMap<String, RowAlias> rowMap = new LinkedHashMap<String, RowAlias>();
            rowMap.put(rAlias1.getAlias(), rAlias1);
            rowMap.put(rAlias2.getAlias(), rAlias2);
            rowMap.put(rAlias3.getAlias(), rAlias3);
            mapping.setRowAlias(rowMap);
           
            ColumnAlias cAlias = new ColumnAlias();
            cAlias.setAlias("col");
            cAlias.setColumnFamily("cf");
            cAlias.setQualifier("qualifier");
            cAlias.setValueType(valueType3);
            mapping.addColumnAlias(cAlias);

            ColumnAlias cAlias1 = new ColumnAlias();
            cAlias1.setAlias("col1");
            cAlias1.setColumnFamily("cf1");
            cAlias.setValueType(valueType3);
            mapping.addColumnAlias(cAlias1);
           
            ColumnAlias cAlias2 = new ColumnAlias();
            cAlias2.setAlias("col2");
            cAlias2.setColumnFamily("cf");
            cAlias2.setQualifier("qualifier1");
            cAlias2.setValueType(valueType3);
            mapping.addColumnAlias(cAlias2);

            RowAliasFilter rowFilter = new RowAliasFilter();
            FilterType filter = new FilterType();
            filter.setType("Greater Than Equals");
            rowFilter.setFilterType(filter);
            rowFilter.setRowAlias(rAlias3);
            rowFilter.setValue("I am a String17");

            ArrayList<RowAliasFilter> filters = new ArrayList<RowAliasFilter>();
            filters.add(rowFilter);
            report.setRowAliasFilters(filters);
           
            Function upper = TestingUtil.getFunction("upper",
            "co.nubetech.crux.server.functions.UpperCase", false);
       
        ReportDesign design = new ReportDesign();
      design.setColumnAlias(cAlias);
      List<ReportDesignFunction> xFunctions = new ArrayList<ReportDesignFunction>();
      xFunctions.add(TestingUtil.getReportDesignFunction(upper, design));
      design.setReportDesignFunctionList(xFunctions);     
      report.addDesign(design);
     
      ReportDesign design1 = new ReportDesign();
      design1.setColumnAlias(cAlias2);
      List<ReportDesignFunction> yFunctions = new ArrayList<ReportDesignFunction>();
      yFunctions.add(TestingUtil.getReportDesignFunction(upper, design1));
      design1.setReportDesignFunctionList(yFunctions);
      report.addDesign(design1);     

            HBaseFacade hbaseFacade = new HBaseFacade(pool);
            CruxScanner scanner = hbaseFacade.execute(connection, report, mapping);
            assertTrue(scanner instanceof CruxScannerResultScannerImpl);
            CruxResult scanResult = null;
View Full Code Here

      scanner.close();
  }
 
  @Test
    public void testRangeScanCompRowAgg() throws IOException, CruxException {
            Report report = new Report();
            Mapping mapping = new Mapping();
            mapping.setTableName(TABLE_2);

            RowAlias rAlias1 = new RowAlias();
            rAlias1.setAlias("rowkeyLong");
            rAlias1.setLength(8);
            rAlias1.setId(1l);
            ValueType valueType1 = new ValueType();
            valueType1.setClassName("java.lang.Long");
            rAlias1.setValueType(valueType1);
            rAlias1.setMapping(mapping);

            RowAlias rAlias2 = new RowAlias();
            rAlias2.setAlias("rowkeyInt");
            rAlias2.setLength(4);
            rAlias2.setId(2l);
            ValueType valueType2 = new ValueType();
            valueType2.setClassName("java.lang.Integer");
            rAlias2.setValueType(valueType2);
            rAlias2.setMapping(mapping);

            RowAlias rAlias3 = new RowAlias();
            rAlias3.setAlias("rowkeyString");
            rAlias3.setId(3l);
            rAlias3.setLength((int) Bytes.toBytes("I am a String" + 11).length);
            ValueType valueType3 = new ValueType();
            valueType3.setClassName("java.lang.String");
            rAlias3.setValueType(valueType3);
            rAlias3.setMapping(mapping);
           
            //add aliases in order
            LinkedHashMap<String, RowAlias> rowMap = new LinkedHashMap<String, RowAlias>();
            rowMap.put(rAlias1.getAlias(), rAlias1);
            rowMap.put(rAlias2.getAlias(), rAlias2);
            rowMap.put(rAlias3.getAlias(), rAlias3);
            mapping.setRowAlias(rowMap);
           
            ColumnAlias cAlias = new ColumnAlias();
            cAlias.setAlias("col");
            cAlias.setColumnFamily("cf");
            cAlias.setQualifier("qualifier");
            cAlias.setValueType(valueType3);
            mapping.addColumnAlias(cAlias);

            ColumnAlias cAlias1 = new ColumnAlias();
            cAlias1.setAlias("col1");
            cAlias1.setColumnFamily("cf1");
            cAlias.setValueType(valueType3);
            mapping.addColumnAlias(cAlias1);
           
            ColumnAlias cAlias2 = new ColumnAlias();
            cAlias2.setAlias("col2");
            cAlias2.setColumnFamily("cf");
            cAlias2.setQualifier("qualifier1");
            cAlias2.setValueType(valueType3);
            mapping.addColumnAlias(cAlias2);

            FilterType filter1 = new FilterType();
        filter1.setType("Greater Than Equals");

        RowAliasFilter rowFilter1 = new RowAliasFilter();
        rowFilter1.setFilterType(filter1);
        rowFilter1.setRowAlias(rAlias1);
        rowFilter1.setValue("15");

        FilterType filter2 = new FilterType();
        filter2.setType("Equals");

        RowAliasFilter rowFilter2 = new RowAliasFilter();
        rowFilter2.setFilterType(filter2);
        rowFilter2.setRowAlias(rAlias2);
        rowFilter2.setValue("12");
       
        FilterType filter3 = new FilterType();
        filter3.setType("Less Than");

        RowAliasFilter rowFilter3 = new RowAliasFilter();
        rowFilter3.setFilterType(filter3);
        rowFilter3.setRowAlias(rAlias1);
        rowFilter3.setValue("20");

        ArrayList<RowAliasFilter> filters = new ArrayList<RowAliasFilter>();
        filters.add(rowFilter1);
        //filters.add(rowFilter2);
        filters.add(rowFilter3);
        report.setRowAliasFilters(filters);
       
            Function max = TestingUtil.getFunction("max",
            "co.nubetech.crux.server.functions.MaxAggregator", false);
            Function min = TestingUtil.getFunction("max",
            "co.nubetech.crux.server.functions.MinAggregator", false);
       
            ReportDesign design3 = new ReportDesign();
      design3.setRowAlias(rAlias1);
      List<ReportDesignFunction> xFunctions = new ArrayList<ReportDesignFunction>();
      xFunctions.add(TestingUtil.getReportDesignFunction(max, design3));
      design3.setReportDesignFunctionList(xFunctions);     
      report.addDesign(design3);
     
      ReportDesign design4 = new ReportDesign();
      design4.setRowAlias(rAlias1);
      List<ReportDesignFunction> functions = new ArrayList<ReportDesignFunction>();
      functions.add(TestingUtil.getReportDesignFunction(min, design4));
      design4.setReportDesignFunctionList(functions);     
      report.addDesign(design4);
     
      HBaseFacade hbaseFacade = new HBaseFacade(pool);
            CruxScanner scanner = hbaseFacade.execute(connection, report, mapping);
            assertTrue(scanner instanceof CruxScannerListImpl);
            CruxResult scanResult = null;
View Full Code Here

TOP

Related Classes of co.nubetech.crux.model.Report

Copyright © 2018 www.massapicom. 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.