/// <exception cref="System.IO.IOException"/> public virtual void Journal(RequestInfo reqInfo, long segmentTxId, long firstTxnId , int numTxns, byte[] records) { QJournalProtocolProtos.JournalRequestProto req = ((QJournalProtocolProtos.JournalRequestProto )QJournalProtocolProtos.JournalRequestProto.NewBuilder().SetReqInfo(Convert(reqInfo )).SetSegmentTxnId(segmentTxId).SetFirstTxnId(firstTxnId).SetNumTxns(numTxns).SetRecords (PBHelper.GetByteString(records)).Build()); try { rpcProxy.Journal(NullController, req); } catch (ServiceException e) { throw ProtobufHelper.GetRemoteException(e); } }
/// <exception cref="System.IO.IOException"/> public virtual void Journal(JournalInfo journalInfo, long epoch, long firstTxnId, int numTxns, byte[] records) { JournalProtocolProtos.JournalRequestProto req = ((JournalProtocolProtos.JournalRequestProto )JournalProtocolProtos.JournalRequestProto.NewBuilder().SetJournalInfo(PBHelper. Convert(journalInfo)).SetEpoch(epoch).SetFirstTxnId(firstTxnId).SetNumTxns(numTxns ).SetRecords(PBHelper.GetByteString(records)).Build()); try { rpcProxy.Journal(NullController, req); } catch (ServiceException e) { throw ProtobufHelper.GetRemoteException(e); } }
private static FsImageProto.INodeSection.XAttrFeatureProto.Builder BuildXAttrs(XAttrFeature f, FSImageFormatProtobuf.SaverContext.DeduplicationMap <string> stringMap) { FsImageProto.INodeSection.XAttrFeatureProto.Builder b = FsImageProto.INodeSection.XAttrFeatureProto .NewBuilder(); foreach (XAttr a in f.GetXAttrs()) { FsImageProto.INodeSection.XAttrCompactProto.Builder xAttrCompactBuilder = FsImageProto.INodeSection.XAttrCompactProto .NewBuilder(); int nsOrd = (int)(a.GetNameSpace()); Preconditions.CheckArgument(nsOrd < 8, "Too many namespaces."); int v = ((nsOrd & XattrNamespaceMask) << XattrNamespaceOffset) | ((stringMap.GetId (a.GetName()) & XattrNameMask) << XattrNameOffset); v |= (((nsOrd >> 2) & XattrNamespaceExtMask) << XattrNamespaceExtOffset); xAttrCompactBuilder.SetName(v); if (a.GetValue() != null) { xAttrCompactBuilder.SetValue(PBHelper.GetByteString(a.GetValue())); } b.AddXAttrs(((FsImageProto.INodeSection.XAttrCompactProto)xAttrCompactBuilder.Build ())); } return(b); }