示例#1
0
 public FileDataStream(Logger Log, FqStreamID FQSID, int num,
                       CallerInfo Ci, LocationInfo Li,
                       StreamFactory.StreamOp op, StreamFactory.StreamSecurityType type,
                       CompressionType ctype, int ChunkSizeForUpload, int UploadThreadPoolSize,
                       string prkey, string pukey, MetaDataService.ACLEntry key_md,
                       IndexInfo ii, bool alreadyExists = true)
     : base(Log, FQSID, num, Ci, Li, op, type, ctype, ChunkSizeForUpload, UploadThreadPoolSize,
            prkey, pukey, key_md, ii, alreadyExists: alreadyExists)
 {
     remoteRead = false;
     // if remote stream, read op. fetch valueFile when needed for get queries
     if (this.synchronizer != null && streamop == StreamFactory.StreamOp.Read)
     {
         remoteRead = true;
     }
 }
示例#2
0
        public ValueDataStream(Logger Log, FqStreamID FQSID, int num,
                               CallerInfo Ci, LocationInfo Li,
                               StreamFactory.StreamOp op, StreamFactory.StreamSecurityType type,
                               CompressionType ctype, int ChunkSizeForUpload, int UploadThreadPoolSize,
                               string prkey, string pukey, MetaDataService.ACLEntry key_md,
                               IndexInfo ii,
                               bool alreadyExists = true)
        {
            Initialize(Log, FQSID, num, Ci, Li, op, type, ctype, ChunkSizeForUpload, UploadThreadPoolSize);

            if (streamtype == StreamFactory.StreamSecurityType.Secure)
            {
                // Key related
                OwnerPriKey = prkey;
                OwnerPubKey = pukey;
                acl_md      = key_md;
            }
            if (logger != null)
            {
                logger.Log("End ValueDataStream Init DataStructures");
            }

            // Fetch data
            FetchAndFillIndex(ii, alreadyExists);

            // Reset sync to upload
            if (op == StreamFactory.StreamOp.Write)
            {
                CreateSync(SynchronizeDirection.Upload);
            }

            isClosed = false;
            if (logger != null)
            {
                logger.Log("Start ValueDataStream ReadFromDisk Open");
            }
            OpenStream();
            if (logger != null)
            {
                logger.Log("End ValueDataStream ReadFromDisk Open");
            }
            disposed = false;
        }