Package org.apache.cassandra.cql3

Examples of org.apache.cassandra.cql3.ResultSet$Metadata$Codec


    List<Row> combinedRows = Lists.newArrayList(first.getRows());
    if (second.getRows() != null) {
      combinedRows.addAll(Lists.newArrayList(second.getRows()));
    }

    ResultSet combinedResultSet = new ResultSet();
    combinedResultSet.getColumnTypes().addAll(first.getColumnTypes());
    combinedResultSet.getRows().addAll(combinedRows);
    return combinedResultSet;
  }
View Full Code Here


      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      // may be left off, i.e. just "SELECT * FROM Browser_Groups LIMIT 500"
      String selectStatement = "SELECT * FROM City WHERE targetable = true LIMIT 500";
      int offset = 0;
      int resultSetSize = 0;
      List<Row> allRows = new ArrayList<Row>();
      ResultSet resultSet;
     
      do {
        StatementBuilder statementBuilder =
            new StatementBuilder(selectStatement + " OFFSET " + offset);
       
        // Get all cities.
        resultSet = pqlService.select(statementBuilder.toStatement());

        // Collect all cities from each page.
        allRows.addAll(Arrays.asList(resultSet.getRows()));
       
        // Display results.
        System.out.println(PqlUtils.resultSetToString(resultSet));
       
        offset += 500;
        resultSetSize = resultSet.getRows() == null ? 0 : resultSet.getRows().length;
      } while (resultSetSize == 500);
     
      System.out.println("Number of results found: " + allRows.size());
     
      // Optionally, save all rows to a CSV.
      resultSet.setRows(allRows.toArray(new Row[] {}));
      CsvUtils.writeCsv(PqlUtils.resultSetToStringArrayList(resultSet), "cities.csv");      
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        HttpURLConnection con = (HttpURLConnection) new URL(request).openConnection();
        con.setRequestProperty("User-Agent", "JMP3renamer MusicBrainz Plug-in " + MusicBrainz.VERSION);
        InputStream in = con.getInputStream();

        Object o = unm.unmarshal(in);
        Metadata md = (Metadata) o;
        ReleaseList rl = md.getReleaseList();
        if (rl != null) {
            List<Release> list = rl.getRelease();
            for (Release release : list) {
                MusicBrainzAlbum mba = new MusicBrainzAlbum();
                mba.setTitle(release.getTitle());
View Full Code Here

        logger.debug("Request: {}", request);
        HttpURLConnection con = (HttpURLConnection) new URL(request).openConnection();
        con.setRequestProperty("User-Agent", "JMP3renamer MusicBrainz Plug-in " + MusicBrainz.VERSION);
        InputStream in = con.getInputStream();

        Metadata md = (Metadata) unm.unmarshal(in);
        MediumList ml = md.getRelease().getMediumList();
        List<Medium> mediums = ml.getMedium();
        for (Medium medium : mediums) {
            TrackList tracks = medium.getTrackList();
            for (Track track : tracks.getDefTrack()) {
                logger.debug("Found track: {}", track.getTitle());
View Full Code Here

  }

  public ResourceBuilderImpl() {
    super();
    _startTime = System.currentTimeMillis();
    codec = new Codec();
    renderers = new HashMap<String, ResourceRenderer>();
    // append known renderers for extentions.
    renderers.put(".gif", new GifRenderer());
    ResourceRenderer renderer = new JpegRenderer();
    renderers.put(".jpeg", renderer);
View Full Code Here

TOP

Related Classes of org.apache.cassandra.cql3.ResultSet$Metadata$Codec

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.