public void parseHDFSElements(InputStream inputStream, IFrameWriter writer, FrameTupleAccessor fta, int tupleIndex) throws IOException { try { Reader input; if (bufferSize > 0) { input = new BufferedReader(new InputStreamReader(inputStream), bufferSize); } else { input = new InputStreamReader(inputStream); } in.setCharacterStream(input); handler.setupElementWriter(writer, tupleIndex); parser.parse(in); input.close(); } catch (IOException e) { HyracksDataException hde = new HyracksDataException(e); hde.setNodeId(nodeId); throw hde; } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void parseHDFSDocument(InputStream inputStream, ArrayBackedValueStorage abvs) throws HyracksDataException { try { Reader input; if (bufferSize > 0) { input = new BufferedReader(new InputStreamReader(inputStream), bufferSize); } else { input = new InputStreamReader(inputStream); } in.setCharacterStream(input); parser.parse(in); handler.writeDocument(abvs); input.close(); } catch (IOException e) { HyracksDataException hde = new HyracksDataException(e); hde.setNodeId(nodeId); throw hde; } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
public void parseElements(File file, IFrameWriter writer, int tupleIndex) throws HyracksDataException { try { Reader input; if (bufferSize > 0) { input = new BufferedReader(new InputStreamReader(new FileInputStream(file)), bufferSize); } else { input = new InputStreamReader(new FileInputStream(file)); } in.setCharacterStream(input); handler.setupElementWriter(writer, tupleIndex); parser.parse(in); input.close(); } catch (FileNotFoundException e) { HyracksDataException hde = new VXQueryFileNotFoundException(e, file); hde.setNodeId(nodeId); throw hde; } catch (SAXException e) { HyracksDataException hde = new VXQueryParseException(e, file); hde.setNodeId(nodeId); throw hde; } catch (IOException e) { HyracksDataException hde = new HyracksDataException(e); hde.setNodeId(nodeId); throw hde; } }
public void parseDocument(File file, ArrayBackedValueStorage abvs) throws HyracksDataException { try { Reader input; if (bufferSize > 0) { input = new BufferedReader(new InputStreamReader(new FileInputStream(file)), bufferSize); } else { input = new InputStreamReader(new FileInputStream(file)); } in.setCharacterStream(input); parser.parse(in); handler.writeDocument(abvs); input.close(); } catch (FileNotFoundException e) { HyracksDataException hde = new VXQueryFileNotFoundException(e, file); hde.setNodeId(nodeId); throw hde; } catch (SAXException e) { HyracksDataException hde = new VXQueryParseException(e, file); hde.setNodeId(nodeId); throw hde; } catch (IOException e) { HyracksDataException hde = new HyracksDataException(e); hde.setNodeId(nodeId); throw hde; } }