public virtual BlockReaderLocal.Builder SetCachingStrategy(CachingStrategy cachingStrategy ) { long readahead = cachingStrategy.GetReadahead() != null?cachingStrategy.GetReadahead () : DFSConfigKeys.DfsDatanodeReadaheadBytesDefault; this.maxReadahead = (int)Math.Min(int.MaxValue, readahead); return(this); }
private static DataTransferProtos.CachingStrategyProto GetCachingStrategy(CachingStrategy cachingStrategy) { DataTransferProtos.CachingStrategyProto.Builder builder = DataTransferProtos.CachingStrategyProto .NewBuilder(); if (cachingStrategy.GetReadahead() != null) { builder.SetReadahead(cachingStrategy.GetReadahead()); } if (cachingStrategy.GetDropBehind() != null) { builder.SetDropBehind(cachingStrategy.GetDropBehind()); } return((DataTransferProtos.CachingStrategyProto)builder.Build()); }