/** * Gets partition where tuple has to be written. Creates the partition if necessary. * * @param t * @return * @throws IOException */ public synchronized Partition getPartitionForTuple(Tuple t) throws IOException { // if(partitioningSpec==null) return // tableDefinition.getDataDir()+"/"+tableDefinition.getName(); long time = TimeEncoding.INVALID_INSTANT; Object value = null; if (partitioningSpec.timeColumn != null) { time = (Long) t.getColumn(partitioningSpec.timeColumn); } if (partitioningSpec.valueColumn != null) { value = t.getColumn(partitioningSpec.valueColumn); ColumnDefinition cd = tableDefinition.getColumnDefinition(partitioningSpec.valueColumn); if (cd.getType() == DataType.ENUM) { value = tableDefinition.addAndGetEnumValue(partitioningSpec.valueColumn, (String) value); } } return createAndGetPartition(time, value); }
public int getColumns() { return _tableDefinition.getColumnDefinition().size(); }
public void buildLineElement(int column, int line) { Object element = _tableDefinition.getColumnDefinition().get(column).getStream().get(line); int index = (line + 1) * getColumns() + column; _outputList.add(index, element); }
public void buildHeadline() { for (int i = 0; i < _tableDefinition.getColumnDefinition().size(); i++) { buildHeadlineElement(i); } }
public void buildHeadlineElement(int column) { _outputList.add(column, _tableDefinition.getColumnDefinition().get(column).getColumnName()); }