Examples of PangoolRuntimeException


Examples of com.datasalt.pangool.PangoolRuntimeException

        deser.open(inputBuffer);
        record2 = deser.deserialize(record2);
        deser.close();
        return compare(record1, record2);
      } catch(IOException e) {
        throw new PangoolRuntimeException(e);
      }
    }
View Full Code Here

Examples of com.datasalt.pangool.PangoolRuntimeException

            b.append((char) bytes[p]);
          }
          b.append("\"}");
          break;
        default:
          throw new PangoolRuntimeException("Not stringifiable type :" + f.getType());
      }
    }
    b.append("}");
    return b.toString();
  }
View Full Code Here

Examples of com.datasalt.pangool.PangoolRuntimeException

     * serialization.
     */
    @SuppressWarnings("rawtypes")
    public void setObjectSerialization(Class<? extends Serialization> serialization) {
      if(type != Type.OBJECT) {
        throw new PangoolRuntimeException("Can't set custom serialization for type " + type);
      }
      if(serializationClass != null) {
        throw new PangoolRuntimeException("Serialization already set :" + serializationClass);
      }
      serializationClass = serialization;
    }
View Full Code Here

Examples of com.datasalt.pangool.PangoolRuntimeException

            nullOrd = NullOrder.valueOf(qualifier.toUpperCase());
            success = true;
          } catch (IllegalArgumentException e) {
          }
          if (!success) {
            throw new PangoolRuntimeException("Unrecognised sort qualifier " + qualifier +
                " on sorting string: " + orderBy + ". Valid qualifiers are " + validQualifiers());
          }
        }
      }
      toReturn.add(fields[0].trim(), ord, nullOrd);
View Full Code Here

Examples of com.datasalt.pangool.PangoolRuntimeException

          ByteBuffer buffer2 = (ByteBuffer) element2;
          int start2 = buffer2.arrayOffset() + buffer2.position();
          int len2 = buffer2.limit() - buffer2.position();
          return compareBytes(buffer1, 0, buffer1.length, buffer2.array(), start2, len2);
        } else {
          throw new PangoolRuntimeException("Can't compare byte[] with " + element2.getClass());
        }
      } else if (element1 instanceof ByteBuffer) {
        ByteBuffer buffer1 = (ByteBuffer) element1;
        int pos1 = buffer1.position();
        int start1 = buffer1.arrayOffset() + pos1;
        int len1 = buffer1.limit() - pos1;
        if (element2 instanceof byte[]) {
          byte[] buffer2 = (byte[]) element2;
          return compareBytes(buffer1.array(), start1, len1, buffer2, 0, buffer2.length);
        } else if (element2 instanceof ByteBuffer) {
          ByteBuffer buffer2 = (ByteBuffer) element2;
          int pos2 = buffer2.position();
          int start2 = buffer2.arrayOffset() + pos2;
          int len2 = buffer2.limit() - pos2;
          return compareBytes(buffer1.array(), start1, len1, buffer2.array(), start2, len2);
        } else {
          throw new PangoolRuntimeException("Can't compare byte[] with " + element2.getClass());
        }
      } else if (element1 instanceof Comparable) {
        return ((Comparable) element1).compareTo(element2);
      } else if (element2 instanceof Comparable) {
        return -((Comparable) element2).compareTo(element1);
      } else {
        throw new PangoolRuntimeException("Not comparable elements:" + element1.getClass() + " with object " + element2.getClass());
      }
    }
  }
View Full Code Here

Examples of com.datasalt.pangool.PangoolRuntimeException

    this.pangoolSchema = AvroUtils.toPangoolSchema(avroSchema);
    this.conf = conf;
    try {
      this.hadoopSer = new HadoopSerialization(conf);
    } catch(IOException e) {
      throw new PangoolRuntimeException(e);
    }

    this.customDeserializers = SerializationInfo.getDeserializers(pangoolSchema, conf);
  }
View Full Code Here

Examples of com.datasalt.pangool.PangoolRuntimeException

          ByteBuffer buffer = (ByteBuffer) objRecord;
          int offset = buffer.arrayOffset() + buffer.position();
          int length = buffer.limit() - buffer.position();
          inputBuffer.reset(buffer.array(), offset, length);
        } else {
          throw new PangoolRuntimeException("Can't convert to OBJECT from instance " + objRecord.getClass());
        }
        if(customDeser != null) {
          customDeser.open(inputBuffer);
          tuple.set(pos, customDeser.deserialize(tuple.get(pos))); // TODO FIXME avro deserializer shouldn't reuse
                                                                   // objects sometimes (UNION ?)
View Full Code Here

Examples of com.datasalt.pangool.PangoolRuntimeException

    this.pangoolSchema = pangoolSchema;
    this.avroSchema = AvroUtils.toAvroSchema(pangoolSchema);
    try{
      this.hadoopSer = new HadoopSerialization(conf);
    } catch(IOException e){
      throw new PangoolRuntimeException(e);
    }
    this.customSerializers = SerializationInfo.getSerializers(pangoolSchema,conf);
    initBuffers();
    schemaValidation = TupleSerialization.getSchemaValidation(conf);
  }
View Full Code Here

Examples of com.datasalt.pangool.PangoolRuntimeException

          ByteBuffer buffer2 = (ByteBuffer)element2;
          int start2 = buffer2.arrayOffset() + buffer2.position();
          int len2 = buffer2.limit() - buffer2.position();
          return compareBytes(buffer1,0,buffer1.length,buffer2.array(),start2,len2);
        } else {
          throw new PangoolRuntimeException("Can't compare byte[] with " + element2.getClass());
        }
      } else if(element1 instanceof ByteBuffer){
        ByteBuffer buffer1 = (ByteBuffer)element1;
        int pos1 = buffer1.position();
        int start1 = buffer1.arrayOffset() + pos1;
        int len1 = buffer1.limit() - pos1;
        if (element2 instanceof byte[]){
          byte[] buffer2 =(byte[]) element2;
          return compareBytes(buffer1.array(),start1,len1,buffer2,0,buffer2.length);
        } else if (element2 instanceof ByteBuffer){
          ByteBuffer buffer2 = (ByteBuffer)element2;
          int pos2 = buffer2.position();
          int start2 = buffer2.arrayOffset() + pos2;
          int len2 = buffer2.limit() - pos2;
          return compareBytes(buffer1.array(),start1,len1,buffer2.array(),start2,len2);
        } else {
          throw new PangoolRuntimeException("Can't compare byte[] with " + element2.getClass());
        }
      }  else if(element1 instanceof Comparable) {
          return ((Comparable) element1).compareTo(element2);
      } else if(element2 instanceof Comparable) {
          return -((Comparable) element2).compareTo(element1);
      } else {
        throw new PangoolRuntimeException("Not comparable elements:" + element1.getClass() + " with object " + element2.getClass());
      }
    }
  }
View Full Code Here

Examples of com.datasalt.pangool.PangoolRuntimeException

     * the field's metadata (properties) is passed to the instance allowing stateful serialization.
     */
    @SuppressWarnings("rawtypes")
    public void setObjectSerialization(Class<? extends Serialization> serialization){
      if (type != Type.OBJECT){
        throw new PangoolRuntimeException("Can't set custom serialization for type " + type);
      }
      if (serializationClass != null){
        throw new PangoolRuntimeException("Serialization already set :" + serializationClass);
      }
      serializationClass = serialization;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.