public List<LlapDaemonProtocolProtos.EvictEntityRequestProto> toProtoRequests() {

      List<LlapDaemonProtocolProtos.EvictEntityRequestProto> protoRequests = new LinkedList<>();

      for (Map.Entry<String, Map<String, Set<LinkedHashMap<String, String>>>> dbEntry : entities.entrySet()) {
        String dbName = dbEntry.getKey();
        Map<String, Set<LinkedHashMap<String, String>>> tables = dbEntry.getValue();

        LlapDaemonProtocolProtos.EvictEntityRequestProto.Builder requestBuilder =
            LlapDaemonProtocolProtos.EvictEntityRequestProto.newBuilder();
        LlapDaemonProtocolProtos.TableProto.Builder tableBuilder = null;

        requestBuilder.setDbName(dbName.toLowerCase());
        for (Map.Entry<String, Set<LinkedHashMap<String, String>>> tableEntry : tables.entrySet()) {
          String tableName = tableEntry.getKey();
          tableBuilder = LlapDaemonProtocolProtos.TableProto.newBuilder();
          tableBuilder.setTableName(tableName.toLowerCase());

          Set<LinkedHashMap<String, String>> partitions = tableEntry.getValue();
          Set<String> partitionKeys = null;

          for (Map<String, String> partitionSpec : partitions) {
            if (partitionKeys == null) {
              // For a given table the set of partition columns (keys) should not change.
              partitionKeys = new LinkedHashSet<>(partitionSpec.keySet());
              tableBuilder.addAllPartKey(partitionKeys);
            }
            for (String partKey : tableBuilder.getPartKeyList()) {
              tableBuilder.addPartVal(partitionSpec.get(partKey));
            }
          }
          requestBuilder.addTable(tableBuilder.build());
        }
        protoRequests.add(requestBuilder.build());
      }
      return protoRequests;
    }
Translate to Protobuf requests.
@return list of request instances ready to be sent over protobuf.
ql/src/java/org/apache/hadoop/hive/llap/ProactiveEviction.java