code: @VisibleForTesting
    List<byte[][]> prepareAllTagvCompounds() {
      List<byte[][]> pre_phase_tags = new LinkedList<byte[][]>();
      pre_phase_tags.add(new byte[tags.get(0).size()][TSDB.tagv_width()]);
  
      List<byte[][]> next_phase_tags = new LinkedList<byte[][]>();
      int next_append_index = 0;
  
      for (final Map.Entry<byte[], byte[][]> tag : tags.get(0)) {
        byte[][] tagv = tag.getValue();
        for (int i = 0; i < tagv.length; ++i) {
          for (byte[][] pre_phase_tag : pre_phase_tags) {
            final byte[][] next_phase_tag = 
                new byte[tags.get(0).size()][tsdb.tag_values.width()];
  
            // copy the tagv from index 0 ~ next_append_index - 1
            for (int k = 0; k < next_append_index; ++k) { 
              System.arraycopy(pre_phase_tag[k], 0, next_phase_tag[k], 0, 
                  tsdb.tag_values.width());
            }
  
            // copy the tagv in next_append_index
            System.arraycopy(tagv[i], 0, next_phase_tag[next_append_index], 0, 
                tsdb.tag_values.width());
            next_phase_tags.add(next_phase_tag);
          }
        } // end for
  
        ++next_append_index;
        pre_phase_tags = next_phase_tags;
        next_phase_tags = new LinkedList<byte[][]>();
      } // end for
      return pre_phase_tags;
    }
docs: We have multiple tagks and each tagk may has multiple possible values.
  This routine generates all the possible tagv compounds basing on the
  present sequence of the tagks. Each compound will be used to generate
  the final tsuid.
  For example, if there are two tag keys where the first tag key has 4 values
  and the second tagk has 2 values then the resulting list will have 6
  entries, one for each permutation.
  
  @return a non-null list that contains all the possible compounds