congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
TrevniRuntimeException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.trevni.TrevniRuntimeException
constructor

Best Java code snippets using org.apache.trevni.TrevniRuntimeException.<init> (Showing top 20 results out of 315)

origin: apache/avro

public void writeLength(int length) throws IOException {
 throw new TrevniRuntimeException("Not an array column: "+meta);
}
origin: apache/avro

private <T extends Comparable> ColumnDescriptor<T> getColumn(String name) {
 ColumnDescriptor column = columnsByName.get(name);
 if (column == null)
  throw new TrevniRuntimeException("No column named: "+name);
 return (ColumnDescriptor<T>)column;
}
origin: apache/avro

private ValueType simpleValueType(Schema s) {
 switch (s.getType()) {
 case NULL:   return ValueType.NULL;
 case BOOLEAN:return ValueType.BOOLEAN;
 case INT:    return ValueType.INT;
 case LONG:   return ValueType.LONG;
 case FLOAT:  return ValueType.FLOAT;
 case DOUBLE: return ValueType.DOUBLE;
 case BYTES:  return ValueType.BYTES;
 case STRING: return ValueType.STRING;
 case ENUM:   return ValueType.INT;
 case FIXED:  return ValueType.BYTES;
 default:
  throw new TrevniRuntimeException("Unknown schema: "+s);
 }
}
origin: apache/avro

/** Set whether this column has an index of blocks by value.  This only makes
 * sense for sorted columns and permits one to seek into a column by value.
 */
public ColumnMetaData hasIndexValues(boolean values) {
 if (isArray)
  throw new TrevniRuntimeException("Array column cannot have index: "+this);
 this.values = values;
 return setReservedBoolean(VALUES_KEY, values);
}
origin: apache/avro

/** Set whether this column is an array. */
public ColumnMetaData isArray(boolean isArray) {
 if (values)
  throw new TrevniRuntimeException("Array column cannot have index: "+this);
 this.isArray = isArray;
 return setReservedBoolean(ARRAY_KEY, isArray);
}
origin: apache/avro

/** Set this column's parent.  A parent must be a preceding array column. */
public ColumnMetaData setParent(ColumnMetaData parent) {
 if (!parent.isArray())
  throw new TrevniRuntimeException("Parent is not an array: "+parent);
 if (values)
  throw new TrevniRuntimeException("Array column cannot have index: "+this);
 this.parent = parent;
 parent.children.add(this);
 return setReserved(PARENT_KEY, parent.getName());
}
origin: apache/avro

private void checkColumns(ColumnMetaData[] columnMeta) {
 Set<String> seen = new HashSet<>();
 for (int i = 0; i < columnMeta.length; i++) {
  ColumnMetaData c = columnMeta[i];
  String name = c.getName();
  if (seen.contains(name))
   throw new TrevniRuntimeException("Duplicate column name: "+name);
  ColumnMetaData parent = c.getParent();
  if (parent != null && !seen.contains(parent.getName()))
   throw new TrevniRuntimeException("Parent must precede child: "+name);
  seen.add(name);
 }
}
origin: apache/avro

@Override
public D next() {
 try {
  for (int i = 0; i < values.length; i++)
   if (values[i] != null)
    values[i].startRow();
  this.column = 0;
  return (D)read(readSchema);
 } catch (IOException e) {
  throw new TrevniRuntimeException(e);
 }
}
origin: apache/avro

public static Checksum get(MetaData meta) {
 String name = meta.getChecksum();
 if (name == null || "null".equals(name))
  return new NullChecksum();
 else if ("crc32".equals(name))
  return new Crc32Checksum();
 else
  throw new TrevniRuntimeException("Unknown checksum: "+name);
}
origin: apache/avro

/** Set a metadata property to a binary value. */
public T set(String key, byte[] value) {
 if (isReserved(key)) {
  throw new TrevniRuntimeException("Cannot set reserved key: " + key);
 }
 put(key, value);
 return (T)this;
}
origin: apache/avro

public static Codec get(MetaData meta) {
 String name = meta.getCodec();
 if (name == null || "null".equals(name))
  return new NullCodec();
 else if ("deflate".equals(name))
  return new DeflateCodec();
 else if ("snappy".equals(name))
  return new SnappyCodec();
 else if ("bzip2".equals(name))
  return new BZip2Codec();
 else
  throw new TrevniRuntimeException("Unknown codec: "+name);
}
origin: apache/avro

@Override public T next() {
 if (column.metaData.isArray() || column.metaData.getParent() != null)
  throw new TrevniRuntimeException
   ("Column is array: " +column.metaData.getName());
 try {
  startRow();
  return nextValue();
 } catch (IOException e) {
  throw new TrevniRuntimeException(e);
 }
}
origin: apache/avro

/** Expert: Must be called before any calls to {@link #nextLength()} or
 * {@link #nextValue()}. */
public void startRow() throws IOException {
 if (row >= column.lastRow(block)) {
  if (block >= column.blockCount())
   throw new TrevniRuntimeException("Read past end of column.");
  startBlock(block+1);
 }
 row++;
}
origin: apache/avro

/** Expert: Returns the next length in an array column. */
public int nextLength() throws IOException {
 if (!column.metaData.isArray())
  throw new TrevniRuntimeException
   ("Column is not array: " +column.metaData.getName());
 assert arrayLength == 0;
 return arrayLength = values.readLength();
}
origin: apache/avro

case ENUM: case FIXED:
 if (read.getType() != write.getType())
  throw new TrevniRuntimeException("Type mismatch: "+read+" & "+write);
 break;
case MAP:
  Integer index = write.getIndexNamed(s.getFullName());
  if (index == null)
   throw new TrevniRuntimeException("No matching branch: "+s);
  findDefaults(s, write.getTypes().get(index));
 throw new TrevniRuntimeException("Unknown schema: "+read);
origin: apache/avro

public <T extends Comparable> T readValue(ValueType type) throws IOException {
 switch (type) {
 case NULL:
  return (T)null;
 case BOOLEAN:
  return (T)Boolean.valueOf(readBoolean());
 case INT:
  return (T)Integer.valueOf(readInt());
 case LONG:
  return (T)Long.valueOf(readLong());
 case FIXED32:
  return (T)Integer.valueOf(readFixed32());
 case FIXED64:
  return (T)Long.valueOf(readFixed64());
 case FLOAT:
  return (T)Float.valueOf(readFloat());
 case DOUBLE:
  return (T)Double.valueOf(readDouble());
 case STRING:
  return (T)readString();
 case BYTES:
  return (T)readBytes(null);
 default:
  throw new TrevniRuntimeException("Unknown value type: "+type);
 }
}
origin: apache/avro

/** Seek to the named value. */
public void seek(T v) throws IOException {
 if (!column.metaData.hasIndexValues())
  throw new TrevniRuntimeException
   ("Column does not have value index: " +column.metaData.getName());
 if (previous == null                          // not in current block?
   || previous.compareTo(v) > 0
   || (block != column.blockCount()-1
     && column.firstValues[block+1].compareTo(v) <= 0))
  startBlock(column.findBlock(v));            // seek to block start
 while (hasNext()) {                           // scan block
  long savedPosition = values.tell();
  T savedPrevious = previous;
  if (next().compareTo(v) >= 0) {
   values.seek(savedPosition);
   previous = savedPrevious;
   row--;
   return;
  }
 }
}
origin: apache/avro

public static int size(Object value, ValueType type) {
 switch (type) {
 case NULL:
  return 0;
 case INT:
  return size((Integer)value);
 case LONG:
  return size((Long)value);
 case FIXED32:
 case FLOAT:
  return 4;
 case FIXED64:
 case DOUBLE:
  return 8;
 case STRING:
  return size((String)value);
 case BYTES:
  if (value instanceof ByteBuffer)
   return size((ByteBuffer)value);
  return size((byte[])value);
 default:
  throw new TrevniRuntimeException("Unknown value type: "+type);
 }
}
origin: apache/avro

public void skipValue(ValueType type) throws IOException {
 switch (type) {
 case NULL:
         break;
 case BOOLEAN:
  readBoolean(); break;
 case INT:
  readInt();    break;
 case LONG:
  readLong();   break;
 case FIXED32:
 case FLOAT:
  skip(4);      break;
 case FIXED64:
 case DOUBLE:
  skip(8);      break;
 case STRING:
 case BYTES:
  skipBytes();  break;
 default:
  throw new TrevniRuntimeException("Unknown value type: "+type);
 }
}
origin: apache/avro

 break;
default:
 throw new TrevniRuntimeException("Unknown value type: "+type);
org.apache.trevniTrevniRuntimeException<init>

Popular methods of TrevniRuntimeException

    Popular in Java

    • Parsing JSON documents to java classes using gson
    • compareTo (BigDecimal)
    • setContentView (Activity)
    • getExternalFilesDir (Context)
    • HttpServer (com.sun.net.httpserver)
      This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
    • Color (java.awt)
      The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
    • FileInputStream (java.io)
      An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
    • FileOutputStream (java.io)
      An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
    • BigInteger (java.math)
      An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
    • HttpServletRequest (javax.servlet.http)
      Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
    • PhpStorm for WordPress
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now