Examples of TupleWriter


Examples of org.apache.hadoop.zebra.types.TypesUtils.TupleWriter

      }

      CGInserter(String name, boolean finishWriter) throws IOException {
        this.name = name;
        this.finishWriter = finishWriter;
        this.tupleWriter = new TupleWriter(getSchema());
        try {
          createTempFile();
          tfileWriter =
            new TFile.Writer(out, getMinBlockSize(conf), cgschema.getCompressor(), cgschema.getComparator(), conf);
          closed = false;
View Full Code Here

Examples of org.apache.hadoop.zebra.types.TypesUtils.TupleWriter

      }

      CGInserter(String name, boolean finishWriter) throws IOException {
        this.name = name;
        this.finishWriter = finishWriter;
        this.tupleWriter = new TupleWriter(getSchema());
        try {
          createTempFile();
          tfileWriter =
            new TFile.Writer(out, getMinBlockSize(conf), cgschema.getCompressor(), cgschema.getComparator(), conf);
          closed = false;
View Full Code Here

Examples of org.apache.hadoop.zebra.types.TypesUtils.TupleWriter

      }

      CGInserter(String name, boolean finishWriter) throws IOException {
        this.name = name;
        this.finishWriter = finishWriter;
        this.tupleWriter = new TupleWriter(getSchema());
        try {
          createTempFile();
          tfileWriter =
              new TFile.Writer(out, getMinBlockSize(conf),
                  getCompression(conf), cgschema.getComparator(), conf);
View Full Code Here

Examples of org.apache.hadoop.zebra.types.TypesUtils.TupleWriter

      }
     
      CGInserter(String name, boolean finishWriter, boolean checkType) throws IOException {
        this.name = name;
        this.finishWriter = finishWriter;
        this.tupleWriter = new TupleWriter(getSchema());
        this.checkType = checkType;
       
        try {
          createTempFile();
          tfileWriter =
View Full Code Here

Examples of org.molgenis.io.TupleWriter

    OutputStream os = mock(OutputStream.class);
    ExcelWriter excelWriter = new ExcelWriter(os);
    excelWriter.addCellProcessor(processor);
    try
    {
      TupleWriter sheetWriter = excelWriter.createTupleWriter("sheet");
      sheetWriter.writeColNames(Arrays.asList("col1", "col2"));
      sheetWriter.write(row1);
    }
    finally
    {
      excelWriter.close();
    }
View Full Code Here

Examples of org.molgenis.io.TupleWriter

    OutputStream os = mock(OutputStream.class);
    ExcelWriter excelWriter = new ExcelWriter(os);
    excelWriter.addCellProcessor(processor);
    try
    {
      TupleWriter sheetWriter = excelWriter.createTupleWriter("sheet");
      sheetWriter.writeColNames(Arrays.asList("col1", "col2"));
      sheetWriter.write(dataTuple);
    }
    finally
    {
      excelWriter.close();
    }
View Full Code Here

Examples of org.molgenis.io.TupleWriter

      tupleTable.setColOffset(0);
      tupleTable.setColLimit(0);
      tupleTable.setOffset(0);
      tupleTable.setLimit(0);

      TupleWriter tupleWriter = excelWriter.createTupleWriter("Sheet1");
      try
      {
        // write header row
        tupleWriter.writeColNames(Iterables.transform(tupleTable.getColumns(), new Function<Field, String>()
        {
          @Override
          @Nullable
          public String apply(@Nullable
          Field field)
          {
            return field != null ? field.getName() : null;
          }
        }));

        // write rows
        for (Iterator<Tuple> it = tupleTable.iterator(); it.hasNext();)
          tupleWriter.write(it.next());
      }
      finally
      {
        IOUtils.closeQuietly(tupleWriter);
View Full Code Here

Examples of org.molgenis.io.TupleWriter

            out.println(db.count(getClassForName(entityName)));
          }
        }
        else
        {
          TupleWriter csvWriter = new CsvWriter(out);
          try
          {
            if (rulesList != null) db.find(getClassForName(entityName), csvWriter,
                rulesList.toArray(new QueryRule[rulesList.size()]));
            else
            {
              db.find(getClassForName(entityName), csvWriter);
            }
          }
          finally
          {
            csvWriter.close();
          }
        }
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.molgenis.io.TupleWriter

      throws ParseException, DatabaseException, Exception
  {
    FormModel<?> view = this.getFormScreen();
    List<String> fieldsToExport = ((FormController<?>) this.getController()).getVisibleColumnNames();
    ExcelWriter excelWriter = new ExcelWriter(xlsDownload);
    TupleWriter sheetWriter = excelWriter.createTupleWriter("Entity");

    try
    {
      sheetWriter.writeColNames(fieldsToExport);

      for (Entity e : view.getRecords())
        sheetWriter.write(new EntityTuple(e));
    }
    finally
    {
      excelWriter.close();
    }
View Full Code Here

Examples of org.molgenis.io.TupleWriter

    // create query rules
    List<QueryRule> rulesList = createQueryRules(req, klazz);

    // execute query
    TupleWriter csvWriter = new CsvWriter(out);
    try
    {
      db.find(klazz, csvWriter, rulesList.toArray(new QueryRule[rulesList.size()]));
    }
    finally
    {
      csvWriter.close();
    }
  }
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.