Examples of Storable


Examples of com.fasterxml.storemate.store.Storable

        List<StorableKey> ids = requestEntity.entries;
        ArrayList<E> entries = new ArrayList<E>(ids.size());
        StorableStore store = _stores.getEntryStore();
       
        for (StorableKey key : ids) {
            Storable raw = store.findEntry(key);
            // note: this may give null as well; caller needs to check (converter passes null as-is)
            E entry = (E) _entryConverter.entryFromStorable(raw);
            entries.add(entry);
        }
        return (OUT) response.ok(new SyncPullResponse<E>(_fileManager, _syncPullSmileWriter, entries));
View Full Code Here

Examples of com.fasterxml.storemate.store.Storable

        ArrayList<E> entries = new ArrayList<E>(ids.size());
        StorableStore store = _stores.getEntryStore();

        try {
            for (StorableKey key : ids) {
                Storable raw = store.findEntry(key);
                // note: this may give null as well; caller needs to check (converter passes null as-is)
                E entry = (E) _entryConverter.entryFromStorable(raw);
                entries.add(entry);
            }
        } catch (StoreException e) {
View Full Code Here

Examples of com.fasterxml.storemate.store.Storable

        StorableStore store = _stores.getEntryStore();

        try {
            for (StorableKey key : ids) {
                // null -> let's not pass 'metadata' yet since we don't use timings?
                Storable raw = store.findEntry(StoreOperationSource.SYNC, null, key);
                // note: this may give null as well; caller needs to check (converter passes null as-is)
                E entry = (E) _entryConverter.entryFromStorable(raw);
                entries.add(entry);
            }
        } catch (StoreException e) {
View Full Code Here

Examples of com.fasterxml.storemate.store.Storable

        List<StorableKey> ids = requestEntity.entries;
        ArrayList<E> entries = new ArrayList<E>(ids.size());
        StorableStore store = _stores.getEntryStore();
       
        for (StorableKey key : ids) {
            Storable raw = store.findEntry(key);
            // note: this may give null as well; caller needs to check (converter passes null as-is)
            E entry = (E) _entryConverter.entryFromStorable(raw);
            entries.add(entry);
        }
        if (metadata != null) {
View Full Code Here

Examples of org.apache.derby.iapi.services.io.Storable

              SanityManager.THROWASSERT(
                "row[key_column_numbers[index]] expected to be Storable, not " +
                row[key_column_numbers[index]].getClass().getName());
            }
          }
          Storable storable = (Storable) row[key_column_numbers[index]];
          if (storable.isNull())
          {
            break;
          }
        }
        // No null key columns
View Full Code Here

Examples of org.apache.derby.iapi.services.io.Storable

            SanityManager.THROWASSERT(
              "row[key_column_numbers[index]] expected to be Storable, not " +
              row[key_column_numbers[index]].getClass().getName());
          }
        }
        Storable storable = (Storable) row[key_column_numbers[index]];
        if (storable.isNull())
        {
          return false;
        }
      }
    }
View Full Code Here

Examples of org.apache.derby.iapi.services.io.Storable

    }

    // if the column is a null column, write the field header now.
    if (column instanceof Storable)
        {
      Storable sColumn = (Storable) column;
      if (sColumn.isNull())
            {
        fieldStatus = StoredFieldHeader.setNull(fieldStatus, true);
        StoredFieldHeader.write(out, fieldStatus, 0, LARGE_SLOT_SIZE);
        return;
      }
    }

    int beginPosition = out.getPosition();
    int fieldDataLength = 0;

    // write out the header, mostly to reserve the space
    StoredFieldHeader.write(
            out, fieldStatus, fieldDataLength, LARGE_SLOT_SIZE);

    if (column instanceof StreamStorable)
        {
      if (((StreamStorable) column).returnStream() != null)
            {
        column = (InputStream) ((StreamStorable) column).returnStream();
      }
    }

    if (column instanceof InputStream)
        {
      InputStream inColumn = (InputStream) column;
      int bufferLen = inColumn.available();
      byte[] bufData = new byte[bufferLen];

      do
            {
        int lenRead = inColumn.read(bufData, bufferLen, 0);
        if (lenRead != -1)
                {
          fieldDataLength += lenRead;
          out.write(bufData, lenRead, 0);
        }
                else
                {
          break;
                }
      } while (true);

    }
        else if (column instanceof Storable)
        {

      Storable sColumn = (Storable) column;
      // write field data to the stream, we already handled the null case
           
      sColumn.writeExternal(logicalDataOut);
      fieldDataLength =
                out.getPosition() - beginPosition - FIELD_HEADER_SIZE;

    }
        else
View Full Code Here

Examples of org.apache.derby.iapi.services.io.Storable

            throw StandardException.newException(
                            SQLState.DATA_NULL_STORABLE_COLUMN,
                            column.getClass().getName());
          }

          Storable sColumn = (Storable) column;

          // is the column null ?
          if (StoredFieldHeader.isNull(fieldStatus))
                    {

            sColumn.restoreToNull();
            arrayPosition++;
            continue;
          }

          inUserCode = true;
          sColumn.readExternal(logicalDataIn);
          inUserCode = false;
          arrayPosition++;
          continue;
        }
View Full Code Here

Examples of org.apache.derby.iapi.services.io.Storable

      page.fetchFromSlot(
                (RecordHandle) null, 0, bigrow.getRow(),
                (FetchDescriptor) null,
                false);

      Storable column;
      String string1 = "01234567890123456789"; // the original 20 char string

      for (int i = 0; i < numcol; i++)
      {
        column = bigrow.getStorableColumn(i);
        if (!(column.toString().equals(string1)))
          throw T_Fail.testFailMsg("Column " + i + " value incorrect, got :" + column.toString());
      }
      for (int i = numcol; i < optimisticNumcol; i++)
      {
        column = bigrow.getStorableColumn(i);
        if (!column.isNull())
          throw T_Fail.testFailMsg("Column " + i +
                       " expect Null, got : " + column.toString());
      }

      REPORT("RTest1 passed");

    }
View Full Code Here

Examples of org.apache.derby.iapi.services.io.Storable

      page.fetchFromSlot(
                (RecordHandle) null, 0, bigrow.getRow(),
                (FetchDescriptor) null,
                false);
      Storable column;
      String string1 = "01234567890123456789"; // the original 20 char string

      for (int i = 0; i < numcol; i++)
      {
        column = bigrow.getStorableColumn(i);
        if (!(column.toString().equals(string1)))
          throw T_Fail.testFailMsg("Column " + i + " value incorrect, got :" + column.toString());
      }
      for (int i = numcol; i < optimisticNumcol; i++)
      {
        column = bigrow.getStorableColumn(i);
        if (!column.isNull())
          throw T_Fail.testFailMsg("Column " + i +
                       " expect Null, got : " + column.toString());
      }

      REPORT("RTest2 passed");

    }
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.