Package org.apache.metamodel

Examples of org.apache.metamodel.MetaModelException


            } finally {
                scanner.close();
            }
            return result;
        } catch (IOException e) {
            throw new MetaModelException(e);
        }
    }
View Full Code Here


        try {
            final ResultScanner scanner = hTable.getScanner(scan);
            return new HBaseDataSet(columns, scanner, hTable);
        } catch (Exception e) {
            FileHelper.safeClose(hTable);
            throw new MetaModelException(e);
        }
    }
View Full Code Here

                if (line == null) {
                    return new EmptyDataSet(columns);
                }
            }
        } catch (IOException e) {
            throw new MetaModelException("IOException occurred while reading from CSV resource: " + _resource, e);
        }

        final boolean failOnInconsistentRowLength = _configuration.isFailOnInconsistentRowLength();

        final Integer maxRowsOrNull = (maxRows > 0 ? maxRows : null);
View Full Code Here

    @Override
    public boolean next() {
        try {
            _nextResult = _scanner.next();
        } catch (IOException e) {
            throw new MetaModelException(e);
        }
        return _nextResult != null;
    }
View Full Code Here

        try {
            final CSVParser parser = _dataSet.getCsvParser();
            return parser.parseLine(_line);
        } catch (IOException e) {
            if (_failOnInconsistentRowLength) {
                throw new MetaModelException("Failed to parse CSV line no. " + _rowNumber + ": " + _line, e);
            } else {
                logger.warn("Encountered unparseable line no. {}, returning line as a single value with trailing nulls: {}", _rowNumber, _line);
                String[] csvValues = new String[_columnsInTable];
                csvValues[0] = _line;
                return csvValues;
View Full Code Here

    if (nextException != null) {
      logger.error("Next SQL exception: " + nextException.getMessage(),
          nextException);
    }

    return new MetaModelException(message, e);
  }
View Full Code Here

            return dataSet;
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            }
            throw new MetaModelException("Unexpected exception while materializing main schema table", e);
        } finally {
            FileHelper.safeClose(inputStream);
        }
    }
View Full Code Here

            return schema;
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            }
            throw new MetaModelException("Unexpected exception while building main schema", e);
        } finally {
            FileHelper.safeClose(inputStream);
        }
    }
View Full Code Here

                dbf.setIgnoringComments(true);
                DocumentBuilder db = dbf.newDocumentBuilder();
                Document document = db.parse(inputSource);
                loadSchema(document);
            } catch (Exception e) {
                throw new MetaModelException("Error parsing XML file: " + e.getMessage(), e);
            }
        }
        return this;
    }
View Full Code Here

            final File file = ((FileResource) _resource).getFile();
            final Writer writer = getFileWriter(file, append);
            try {
                writer.write(line);
            } catch (IOException e) {
                throw new MetaModelException("Failed to write line to file: " + line, e);
            }
        } else {
            // generic handling for any kind of resource
            final Action<OutputStream> action = new Action<OutputStream>() {
                @Override
View Full Code Here

TOP

Related Classes of org.apache.metamodel.MetaModelException

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.