code: @Override
      public void writeForeignKeys(HTableInterface hTable, String rowKey, Map<String, Set<String>> foreignKeyMap)
              throws IOException
      {
          Put p = new Put(Bytes.toBytes(rowKey));
  
          // Checking if foreign key column family exists
          Get g = new Get(Bytes.toBytes(rowKey));
          Result r = hTable.get(g);
  
          boolean isPresent = false;
  
          for (Map.Entry<String, Set<String>> entry : foreignKeyMap.entrySet())
          {
              String property = entry.getKey(); // Foreign key name
              Set<String> foreignKeys = entry.getValue();
              String keys = MetadataUtils.serializeKeys(foreignKeys);
  
              // Check if there was any existing foreign key value, if yes, append
              // it
              byte[] value = r.getValue(Bytes.toBytes(Constants.FOREIGN_KEY_EMBEDDED_COLUMN_NAME),
                      Bytes.toBytes(property));
              String existingForeignKey = Bytes.toString(value);
  
              if (existingForeignKey == null || existingForeignKey.isEmpty())
              {
                  p.add(Bytes.toBytes(Constants.FOREIGN_KEY_EMBEDDED_COLUMN_NAME), Bytes.toBytes(property),
                          Bytes.toBytes(keys));
                  isPresent = true;
              }
              else
              {
                  p.add(Bytes.toBytes(Constants.FOREIGN_KEY_EMBEDDED_COLUMN_NAME), Bytes.toBytes(property),
                          Bytes.toBytes(existingForeignKey + Constants.FOREIGN_KEY_SEPARATOR + keys));
                  isPresent = true;
              }
          }
          if (isPresent)
          {
              hTable.put(p);
          }
      }
docs: /*
  (non-Javadoc)
  
  @see
  com.impetus.client.hbase.Writer#writeForeignKeys(org.apache.hadoop.hbase
  .client.HTable, java.lang.String, java.util.Map)