use of com.facebook.buck.artifact_cache.thrift.RuleKey in project buck by facebook.
the class HybridPayloadGenerator method createFetchRequest.
private BuckCacheRequest createFetchRequest() {
BuckCacheFetchRequest fetchRequest = new BuckCacheFetchRequest();
RuleKey ruleKey = new RuleKey();
ruleKey.setHashString(STORE_RULE_KEY_ONE);
fetchRequest.setRuleKey(ruleKey);
BuckCacheRequest cacheRequest = new BuckCacheRequest();
cacheRequest.setType(BuckCacheRequestType.FETCH);
cacheRequest.setFetchRequest(fetchRequest);
cacheRequest.setType(BuckCacheRequestType.FETCH);
return cacheRequest;
}
use of com.facebook.buck.artifact_cache.thrift.RuleKey in project buck by facebook.
the class HybridPayloadGenerator method createStoreRequest.
private BuckCacheRequest createStoreRequest() {
BuckCacheRequest cacheRequest = new BuckCacheRequest();
cacheRequest.setType(BuckCacheRequestType.STORE);
BuckCacheStoreRequest storeRequest = new BuckCacheStoreRequest();
ArtifactMetadata metadata = new ArtifactMetadata();
RuleKey ruleKeyOne = new RuleKey();
ruleKeyOne.setHashString(STORE_RULE_KEY_ONE);
RuleKey ruleKeyTwo = new RuleKey();
ruleKeyTwo.setHashString(STORE_RULE_KEY_TWO);
List<RuleKey> ruleKeys = new ArrayList<>();
ruleKeys.add(ruleKeyOne);
ruleKeys.add(ruleKeyTwo);
metadata.setRuleKeys(ruleKeys);
Map<String, String> metadataMap = new HashMap<>();
metadataMap.put(METDATA_KEY_ONE, METDATA_VALUE_ONE);
metadataMap.put(METDATA_KEY_TWO, METDATA_VALUE_TWO);
metadata.setRuleKeys(ruleKeys);
metadata.setMetadata(metadataMap);
List<PayloadInfo> payloadInfos = new ArrayList<>();
PayloadInfo payloadInfo = new PayloadInfo();
payloadInfo.setSizeBytes(PAYLOAD_ONE_BYTES.length);
payloadInfos.add(payloadInfo);
storeRequest.setMetadata(metadata);
cacheRequest.setStoreRequest(storeRequest);
cacheRequest.setPayloads(payloadInfos);
return cacheRequest;
}
Aggregations