Examples of bytes()


Examples of net.openhft.lang.io.MappedStore.bytes()

            int ringIndexLocationsStart = 0;
            int ringIndexLocationsLen = SIZE_OF_INT * 2;
            int storeLen = capacity * align(maxSize, 4);

            final MappedStore ms = new MappedStore(file, FileChannel.MapMode.READ_WRITE, ringIndexLocationsLen + storeLen);
            final DirectBytes ringIndexSlice = ms.bytes(ringIndexLocationsStart, ringIndexLocationsLen);
            ringIndex = new SharedRingIndex(ringIndexSlice);

            // provides an index to the data in the ring buffer, the size of this index is proportional to the capacity of the ring buffer
            final DirectBytes storeSlice = ms.bytes(ringIndexLocationsLen, storeLen);
            dataLocator = new SharedLocalDataLocator(capacity, maxSize, storeSlice, clazz);
View Full Code Here

Examples of net.openhft.lang.values.IntValue$$Native.bytes()

        final SharedHashMap<IntValue, CharSequence> map = new SharedHashMapBuilder()
                .entries(1000)
                .entries(20000).file(getPersistenceFile()).kClass(IntValue.class).vClass(CharSequence.class).create();

        IntValue$$Native value = new IntValue$$Native();
        value.bytes(new ByteBufferBytes(ByteBuffer.allocateDirect(4)), 0);

        value.setValue(1);
        final String expected = "test";
        map.put(value, expected);
View Full Code Here

Examples of net.tomp2p.storage.DataBuffer.bytes()

    byte[] oldValue = "ZurichGenevaLuganoAAA".getBytes();
    byte[] newValue = "AzurichGenevaLuganoAbbLuganoAAA".getBytes();
    List<Checksum> checksums = RSync.checksums(oldValue, size);
    List<Instruction> instructions = RSync.instructions(newValue, checksums, size);
    DataBuffer reconstructedValue = RSync.reconstruct(oldValue, instructions, size);
    Assert.assertArrayEquals(newValue, reconstructedValue.bytes());
  }
 
  @Test
  public void testGetReconstructedValueStatic1() throws IOException, NoSuchAlgorithmException {
    // oldValue and newValue are set manually
View Full Code Here

Examples of org.apache.avro.generic.GenericData.Fixed.bytes()

      // This also gets us around the Enum issue since we just take the value
      // and convert it to a string. Yay!
    case BINARY:
      if (recordSchema.getType() == Type.FIXED){
        Fixed fixed = (Fixed) datum;
        return fixed.bytes();
      } else if (recordSchema.getType() == Type.BYTES){
        return AvroSerdeUtils.getBytesFromByteBuffer((ByteBuffer) datum);
      } else {
        throw new AvroSerdeException("Unexpected Avro schema for Binary TypeInfo: " + recordSchema.getType());
      }
View Full Code Here

Examples of org.apache.avro.generic.GenericFixed.bytes()

     * Called to read a fixed value. Overridden to read a pig byte array.
     */
    @Override
    protected Object readFixed(Object old, Schema expected, Decoder in) throws IOException {
        GenericFixed fixed = (GenericFixed) super.readFixed(old, expected, in);
        DataByteArray byteArray = new DataByteArray(fixed.bytes());
        return byteArray;
     }

    /**
     * Called to create new record instances. Overridden to return a new tuple.
View Full Code Here

Examples of org.apache.avro.specific.SpecificFixed.bytes()

      LOG.warn("Not an instance of SpecificFixed");
      return null;
    }

    SpecificFixed fixed = (SpecificFixed) value;
    byte[] bytes = fixed.bytes();
    try {
      byteBuffer.get(bytes, 0, bytes.length);
    }
    catch (BufferUnderflowException e) {
      // LOG.info(e.toString() + " : class=" + clazz.getName() + " length=" + bytes.length);
View Full Code Here

Examples of org.apache.lucene.index.Term.bytes()

        final TermState state = states[i].get(context.ord);
        if (state == null) { /* term doesnt exist in this segment */
          assert this.termNotInReader(reader, t): "no termstate found but term exists in reader";
          return null;
        }
        te.seekExact(t.bytes(), state);

        final DocsNodesAndPositionsEnum postingsEnum = NodePhraseQuery.this.getDocsNodesAndPositionsEnum(te.docsAndPositions(liveDocs, null));

        // PhraseQuery on a field that did not index positions (maybe not a siren field)
        if (postingsEnum == null) {
View Full Code Here

Examples of org.apache.lucene.index.Term.bytes()

        final DocsNodesAndPositionsEnum postingsEnum = NodePhraseQuery.this.getDocsNodesAndPositionsEnum(te.docsAndPositions(liveDocs, null));

        // PhraseQuery on a field that did not index positions (maybe not a siren field)
        if (postingsEnum == null) {
          assert te.seekExact(t.bytes(), false) : "termstate found but no term exists in reader";
          // term does exist, but has no positions
          throw new IllegalStateException("field \"" + t.field() + "\" was " +
              "indexed without position data; cannot run NodePhraseQuery " +
              "(term=" + t.text() + ")");
        }
View Full Code Here

Examples of org.apache.lucene.index.Term.bytes()

    }
    if (query instanceof TermQuery) {
      TermQuery tq = (TermQuery) query;
      Term term = tq.getTerm();
      if (term.field().equals(fieldLessFieldName)) {
        return new TermQuery(new Term(name, term.bytes()));
      }
    } else if (query instanceof WildcardQuery) {
      WildcardQuery wq = (WildcardQuery) query;
      Term term = wq.getTerm();
      if (term.field().equals(fieldLessFieldName)) {
View Full Code Here

Examples of org.apache.lucene.index.Term.bytes()

      }
    } else if (query instanceof WildcardQuery) {
      WildcardQuery wq = (WildcardQuery) query;
      Term term = wq.getTerm();
      if (term.field().equals(fieldLessFieldName)) {
        return new WildcardQuery(new Term(name, term.bytes()));
      }
    } else if (query instanceof MultiPhraseQuery) {
      MultiPhraseQuery mpq = (MultiPhraseQuery) query;
      int[] positions = mpq.getPositions();
      List<Term[]> termArrays = mpq.getTermArrays();
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.