15 package com.cloudera.impala.analysis;
17 import java.math.BigDecimal;
21 import com.cloudera.impala.thrift.THdfsCachingOp;
22 import com.google.common.base.Preconditions;
36 cacheOp_ =
new THdfsCachingOp(
false);
46 cacheOp_.setCache_pool_name(cachePoolName);
53 String poolName = cacheOp_.getCache_pool_name();
54 Preconditions.checkNotNull(poolName);
55 if (poolName.isEmpty()) {
59 HdfsCachePool cachePool = analyzer.getCatalog().getHdfsCachePool(poolName);
60 if (cachePool == null) {
62 "The specified cache pool does not exist: " + poolName);
66 parsedReplication_.longValue() > Short.MAX_VALUE)) {
68 "Cache replication factor must be between 0 and Short.MAX_VALUE");
72 cacheOp_.setReplication(parsedReplication_.shortValue());
80 "REPLICATION = " + parsedReplication_.longValue();
85 public boolean shouldCache() {
return cacheOp_.isSet_cached(); }
88 return shouldCache() ? cacheOp_.getCache_pool_name() : null;
final THdfsCachingOp cacheOp_
THdfsCachingOp toThrift()
String getCachePoolName()
void analyze(Analyzer analyzer)
HdfsCachingOp(String cachePoolName, BigDecimal replication)
final BigDecimal parsedReplication_