@Override public TextTableNode clone() { TextTableNode clone = new TextTableNode(getID()); this.copyTo(clone); clone.setTable(table); return clone; }
private List<String> parseFixedWidth(StringBuilder line) { ArrayList<String> result = new ArrayList<String>(); int beginIndex = 0; for (TextColumn col : table.getColumns()) { if (beginIndex >= line.length()) { result.add(null); } else { String val = new String(line.substring(beginIndex, Math.min(line.length(), beginIndex + col.getWidth()))); addValue(result, col.isNoTrim(), val); beginIndex += col.getWidth(); } } return result; }
initReader(); terminateBatches(); return pullBatch(); if (isLastBatch()) { return pullBatch(); if (isBatchFull()) { TupleBatch result = pullBatch(); processAsynch(); // read ahead return result; unwrapException(asynchException); processAsynch(); if (this.getContext().getWorkItem() == null) {
private void initReader() throws ExpressionEvaluationException, BlockedException, TeiidComponentException, TeiidProcessingException { setReferenceValues(this.table); ClobType file = (ClobType)getEvaluator(Collections.emptyMap()).evaluate(table.getFile(), null); if (file == null) { return; boolean isHeader = textLine == header; if (isHeader) { StringBuilder line = readLine(DataTypeManager.MAX_STRING_LENGTH * 16, false); if (line == null) { //just return an empty batch reset(); return; processHeader(parseLine(line)); } else { while (readChar() != newLine) {
private void process() throws TeiidProcessingException { while (true) { synchronized (this) { if (isBatchFull()) { return; StringBuilder line = readLine(lineWidth, table.isFixedWidth()); terminateBatches(); break; List<String> vals = parseLine(line); addBatchRow(tuple); terminateBatches(); break;
Map<Expression, Integer> elementMap = createLookupMap(table.getProjectedSymbols()); this.projectionIndexes = getProjectionIndexes(elementMap, getElements());
line = readLine(lineWidth, false); continue; addValue(result, wasQualified || noTrim, builder.toString()); return result; line = readLine(lineWidth, false); if (line == null) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30182, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30182, systemId)); escaped = false; } else { addValue(result, wasQualified || noTrim, builder.toString()); wasQualified = false; builder = new StringBuilder(); //next entry
TextTableNode ttn = new TextTableNode(getID()); TextTable tt = (TextTable)source; updateGroupName(node, tt); ttn.setTable(tt); processNode = ttn; break;
private void processAsynch() { if (!running) { running = true; getContext().getExecutor().execute(new Runnable() { @Override public void run() { try { process(); } catch (TeiidRuntimeException e) { asynchException = e; } catch (Throwable e) { asynchException = new TeiidRuntimeException(e); } finally { running = false; RequestWorkItem workItem = TextTableNode.this.getContext().getWorkItem(); if (workItem != null) { workItem.moreWork(); } else { synchronized (TextTableNode.this) { TextTableNode.this.notifyAll(); } } } } }); } }
private void initReader() throws ExpressionEvaluationException, BlockedException, TeiidComponentException, TeiidProcessingException { setReferenceValues(this.table); ClobType file = (ClobType)getEvaluator(Collections.emptyMap()).evaluate(table.getFile(), null); if (file == null) { return; boolean isHeader = textLine == header; if (isHeader) { StringBuilder line = readLine(DataTypeManager.MAX_STRING_LENGTH * 16, false); if (line == null) { //just return an empty batch reset(); return; processHeader(parseLine(line)); } else { while (readChar() != newLine) {
private void process() throws TeiidProcessingException { while (true) { synchronized (this) { if (isBatchFull()) { return; StringBuilder line = readLine(lineWidth, table.isFixedWidth()); terminateBatches(); break; List<String> vals = parseLine(line); addBatchRow(tuple); terminateBatches(); break;
Map<Expression, Integer> elementMap = createLookupMap(table.getProjectedSymbols()); this.projectionIndexes = getProjectionIndexes(elementMap, getElements());
line = readLine(lineWidth, false); continue; addValue(result, wasQualified || noTrim, builder.toString()); return result; line = readLine(lineWidth, false); if (line == null) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30182, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30182, systemId)); escaped = false; } else { addValue(result, wasQualified || noTrim, builder.toString()); wasQualified = false; builder = new StringBuilder(); //next entry
TextTableNode ttn = new TextTableNode(getID()); TextTable tt = (TextTable)source; updateGroupName(node, tt); ttn.setTable(tt); processNode = ttn; break;
private void processAsynch() { if (!running) { running = true; getContext().getExecutor().execute(new Runnable() { @Override public void run() { try { process(); } catch (TeiidRuntimeException e) { asynchException = e; } catch (Throwable e) { asynchException = new TeiidRuntimeException(e); } finally { running = false; RequestWorkItem workItem = TextTableNode.this.getContext().getWorkItem(); if (workItem != null) { workItem.moreWork(); } else { synchronized (TextTableNode.this) { TextTableNode.this.notifyAll(); } } } } }); } }
initReader(); terminateBatches(); return pullBatch(); if (isLastBatch()) { return pullBatch(); if (isBatchFull()) { TupleBatch result = pullBatch(); processAsynch(); // read ahead return result; unwrapException(asynchException); processAsynch(); if (this.getContext().getWorkItem() == null) {
private void initReader() throws ExpressionEvaluationException, BlockedException, TeiidComponentException, TeiidProcessingException { setReferenceValues(this.table); ClobType file = (ClobType)getEvaluator(Collections.emptyMap()).evaluate(table.getFile(), null); if (file == null) { return; boolean isHeader = textLine == header; if (isHeader) { StringBuilder line = readLine(DataTypeManager.MAX_STRING_LENGTH * 16, false); if (line == null) { //just return an empty batch reset(); return; processHeader(parseLine(line)); } else { while (readChar() != newLine) {
private void process() throws TeiidProcessingException { while (true) { synchronized (this) { if (isBatchFull()) { return; StringBuilder line = readLine(lineWidth, table.isFixedWidth()); terminateBatches(); break; List<String> vals = parseLine(line); addBatchRow(tuple); terminateBatches(); break;