code: public static <K, N> byte[] serializeKeyAndNamespace(
  			K key,
  			TypeSerializer<K> keySerializer,
  			N namespace,
  			TypeSerializer<N> namespaceSerializer) throws IOException {
  
  		DataOutputSerializer dos = new DataOutputSerializer(32);
  
  		keySerializer.serialize(key, dos);
  		dos.writeByte(MAGIC_NUMBER);
  		namespaceSerializer.serialize(namespace, dos);
  
  		return dos.getCopyOfBuffer();
  	}
docs: Serializes the key and namespace into a {@link ByteBuffer}.
  
  <p>The serialized format matches the RocksDB state backend key format, i.e.
  the key and namespace don't have to be deserialized for RocksDB lookups.
  
  @param key                 Key to serialize
  @param keySerializer       Serializer for the key
  @param namespace           Namespace to serialize
  @param namespaceSerializer Serializer for the namespace
  @param <K>                 Key type
  @param <N>                 Namespace type
  @return Buffer holding the serialized key and namespace
  @throws IOException Serialization errors are forwarded