Retrieve the persisted data for recovering the given segment from disk.
770334
private PersistedRecoveryPaxosData getPersistedPaxosData(long segmentTxId)
      throws IOException {
    File f = journalStorage.getPaxosFile(segmentTxId);
    if (!f.exists()) {
      // Default instance has no fields filled in (they're optional)
      return null;
    }
    
    InputStream in = new FileInputStream(f);
    try {
      PersistedRecoveryPaxosData ret = PersistedRecoveryPaxosData.parseDelimitedFrom(in);
      Preconditions.checkState(ret != null &&
          ret.getSegmentState().getStartTxId() == segmentTxId,
          "Bad persisted data for segment %s: %s",
          segmentTxId, ret);
      return ret;
    } finally {
      IOUtils.closeStream(in);
    }
  }
926273
def __retrieve_internal_blob(self, key):
        ''' 
        '''
        logger = getLogger()
        with self.get_conn() as conn:
            try:
                c = conn.cursor()
                if key is None:
                    c.execute("SELECT compressed, blob_data FROM blob_entries WHERE KEY IS NULL")
                else:
                    c.execute("SELECT compressed, blob_data FROM blob_entries WHERE KEY = ?", (key,))
                result = c.fetchone()
                if not result:
                    logger.debug("There's no blob entry with key={key}".format(key=key))
                    logger.debug("result = {res}".format(res=result))
                    return None
                else:
                    compressed, blob_data = result
                    logger.debug("retrieving internal BLOB (key={key} | len={ln} | compressed={c})".format(key=key, ln=len(blob_data), c=compressed))
                    return blob_data if not compressed else zlib.decompress(blob_data)
            except:
                getLogger().exception("Cannot retrieve internal blob (key={})".format(key))
                return None
            return True
1257421
public List<DataSlice> getPersistentData() {
    List<DataSlice> slices = new ArrayList<DataSlice>(1);
    slices.add(new DataSlice(schema.toByteArray()));
    return slices;
  }
1343513
def get_raw_data(self, ptr, unbuffered=False):
        """"""
        if unbuffered:
            self._data_pos = None
        # round down ptr to a 'block boundary'
        idx = ptr - (ptr % 0x20)
        ptr -= idx
        count = self.reading_len[self.ws_type]
        if self._data_pos == idx:
            # cache contains useful data
            result = self._data_block[ptr:ptr + count]
            if len(result) >= count:
                return result
        else:
            result = list()
        if ptr + count > 0x20:
            # need part of next block, which may be in cache
            if self._data_pos != idx + 0x20:
                self._data_pos = idx + 0x20
                self._data_block = self._read_block(self._data_pos)
            result += self._data_block[0:ptr + count - 0x20]
            if len(result) >= count:
                return result
        # read current block
        self._data_pos = idx
        self._data_block = self._read_block(self._data_pos)
        result = self._data_block[ptr:ptr + count] + result
        return result
1282906
@Override
    public Data readBackupData(Data key) {
        Record record = getRecord(key);

        if (record == null) {
            return null;
        } else {
            if (partitionService.isPartitionOwner(partitionId)) {
                // set last access time to prevent
                // premature removal of the entry because
                // of idleness based expiry
                record.setLastAccessTime(Clock.currentTimeMillis());
            }
        }

        Object value = record.getValue();
        mapServiceContext.interceptAfterGet(name, value);
        // this serialization step is needed not to expose the object, see issue 1292
        return mapServiceContext.toData(value);
    }
248887
public static String getHdfsStorageDir(DataSegment segment)
  {
    return JOINER.join(
        segment.getDataSource(),
        String.format(
            "%s_%s",
            segment.getInterval().getStart().toString(ISODateTimeFormat.basicDateTime()),
            segment.getInterval().getEnd().toString(ISODateTimeFormat.basicDateTime())
        ),
        segment.getVersion().replaceAll(":", "_"),
        segment.getShardSpec().getPartitionNum()
    );
  }
559087
def getcandsfile(d, segment=-1, domock=False):
    
    if domock:
        prefix = 'candsmock_'
    else:
        prefix= 'cands_'

    if d.has_key('segment'):
        return os.path.join(d['workdir'], prefix + d['fileroot'] + '_sc' + str(d['scan']) + 'seg' + str(d['segment']) + '.pkl')
    elif segment >= 0:
        return os.path.join(d['workdir'], prefix + d['fileroot'] + '_sc' + str(d['scan']) + 'seg' + str(segment) + '.pkl')
    else:
        return ''
370133
def get_segment(self, segment_id):
        
        return model.Segment.deserialize(self.protocol.get('/segments/{id}',
                                         id=segment_id), bind_client=self)
780119
public void getPersistentData(ObjectOutputStream oos)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", oos);

    super.getPersistentData(oos);
    
    try
    {
      HashMap hm = new HashMap();

      if (durableSubName != null)
        hm.put("durableSubName", durableSubName);
      
      oos.writeObject(hm);
    }
    catch (IOException e)
    {
      // FFDC
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.store.itemstreams.PtoPReceiveMsgsItemStream.getPersistentData",
        "1:301:1.26.1.2",
        this);
        
      SibTr.exception(tc, e);
      if (tc.isEntryEnabled()) SibTr.exit(tc, "getPersistentData", "SIErrorException");
      
      throw new SIErrorException(
       nls.getFormattedMessage(
        "INTERNAL_MESSAGING_ERROR_CWSIP0003",
        new Object[] {
          "com.ibm.ws.sib.processor.impl.store.itemstreams.PtoPMessageItemStream",
          "1:312:1.26.1.2",
          e,
          getDestinationHandler().getName()},
        null),
        e);
    }

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
906558
public void getPersistentData(ObjectOutputStream oos)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", oos);

    try
    {
      HashMap hm = new HashMap();

      if (durablePseudoDestID != null)
        hm.put("durablePseudoDestID", durablePseudoDestID.toByteArray());
      if (durableSubName != null)
        hm.put("durableSubName", durableSubName);
      
      oos.writeObject(hm);
    }
    catch (IOException e)
    {
      // FFDC
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.store.itemstreams.AOContainerItemStream.getPersistentData",
        "1:113:1.13",
        this);
        
      SIErrorException e2 = new SIErrorException(e);
      SibTr.exception(tc, e2);
      if (tc.isEntryEnabled()) SibTr.exit(tc, "getPersistentData", e2);
      throw e2;
    }

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
1207539
def restore(self, state):
        

        selector = DataStreamSelector.FromString(state.get(u'selector'))
        if selector != self.selector:
            raise ArgumentError("Attempted to restore a BufferedStreamWalker with a different selector",
                                selector=self.selector, serialized_data=state)

        self.seek(state.get(u'offset'), target="offset")
104792
public void getPersistentData(ObjectOutputStream oos)
  {    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", oos);

    try
    {
      HashMap hm = new HashMap();
      
      hm.put("iTopicSpace", _topicSpaceUuid.toString());
      hm.put("iTopic", _topic);
      hm.put("iForeignTopicSpaceName", _foreignTopicSpaceName);
      hm.put("isForeignSecuredProxy", new Boolean(_foreignSecuredProxy));
      hm.put("MESubUserId", _meSubUserId);
                  
      oos.writeObject(hm);
    }
    catch (java.io.IOException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.proxyhandler.MESubscription.getPersistentData",
        "1:848:1.55",
        this);

      SibTr.exception(tc, e);
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
        new Object[] {
          "com.ibm.ws.sib.processor.proxyhandler.MESubscription",
          "1:855:1.55",
          e });
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getPersistentData", "SIErrorException");
      
      throw new SIErrorException(
        nls.getFormattedMessage(
          "INTERNAL_MESSAGING_ERROR_CWSIP0002",
          new Object[] {
            "com.ibm.ws.sib.processor.proxyhandler.MESubscription",
            "1:865:1.55",
            e },
          null),
        e);
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
779763
def _flush(self):
        
        if self._recording:
            raise Exception("Cannot flush data queue while recording!")
        if self._saving_cache:
            logging.warn("Flush when using cache means unsaved data will be lost and not returned!")
            self._cmds_q.put(("reset_data_segment",))
        else:
            data = self._extract_q(0)
            return data
1129695
public Long retrieveChecksum(Block lostBlock, Path p,
      long lostBlockOffset, FileSystem fs, Context context) 
          throws IOException {
    Long oldCRC = null;  
    if (checksumStore != null) { 
      IOException caughtException = null;
      try {
        oldCRC = checksumStore.getChecksum(lostBlock); 
      } catch (IOException ioe) {
        LOG.error(" Fail to get checksum for block " + lostBlock, ioe);
        caughtException = ioe;
      }
      // Checksum is not record, we should report
      if (oldCRC == null) {
        LogUtils.logRaidReconstructionMetrics(LOGRESULTS.FAILURE, 0,
            codec, p, lostBlockOffset,
            LOGTYPES.OFFLINE_RECONSTRUCTION_GET_CHECKSUM,
            fs, caughtException, context);
      }
    }
    return oldCRC;
  }
754774
public void getPersistentData(ObjectOutputStream dout)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", dout);

    try
    {
      dout.writeLong(tick);
      dout.writeLong(msgId);
      dout.writeInt(storagePolicy);
      dout.writeLong(plockId);
      dout.writeLong(prevTick);
      dout.writeLong(waitTime);
      dout.writeInt(priority);
      dout.writeInt(reliability);
      dout.writeLong(aiRequestTick);
      dout.writeUTF(sourceMEUuid.toString());
    }
    catch (IOException e)
    {
      // No FFDC code needed
      SIErrorException e2 = new SIErrorException(e);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "getPersistentData", e2);

      throw e2;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }
470897
@Override
    public final List<DataSlice> readDataFromPersistence() throws SevereMessageStoreException
    {
        List<DataSlice> dataSlices;
        // lazy restoration only needed if the item was stored.  There is
        // no point trying to restore if there is no data.
        PersistentMessageStore pm = getMessageStoreImpl().getPersistentMessageStore();
        try
        {
            dataSlices = pm.readDataOnly(getTuple());
        } catch (PersistenceException pe)
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.readDataFromPersistence", "1:3271:1.241", this);
            throw new SevereMessageStoreException(pe);
        }

        return dataSlices;
    }
330235
public void getPersistentData(ObjectOutputStream dout)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPersistentData", dout);

    try
    {
      dout.writeUTF(_streamKey);
      dout.writeUTF(_streamId.toString());
    }
    catch (IOException e)
    {
      // No FFDC code needed
      SIErrorException e2 = new SIErrorException(e);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "getPersistentData", e2);

      throw e2;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPersistentData");
  }