org.apache.hadoop.hdfs.web
Class JsonUtil

java.lang.Object
  extended by org.apache.hadoop.hdfs.web.JsonUtil

public class JsonUtil
extends Object

JSON Utilities


Constructor Summary
JsonUtil()
           
 
Method Summary
static org.apache.hadoop.fs.ContentSummary toContentSummary(Map<?,?> json)
          Convert a Json map to a ContentSummary.
static org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> toDelegationToken(Map<?,?> json)
          Convert a Json map to a Token of DelegationTokenIdentifier.
static org.apache.hadoop.hdfs.protocol.HdfsFileStatus toFileStatus(Map<?,?> json, boolean includesType)
          Convert a Json map to a HdfsFileStatus object.
static String toJsonString(org.apache.hadoop.fs.ContentSummary contentsummary)
          Convert a ContentSummary to a Json string.
static String toJsonString(Exception e)
          Convert an exception object to a Json string.
static String toJsonString(org.apache.hadoop.hdfs.protocol.HdfsFileStatus status, boolean includeType)
          Convert a HdfsFileStatus object to a Json string.
static String toJsonString(org.apache.hadoop.hdfs.protocol.LocatedBlocks locatedblocks)
          Convert LocatedBlocks to a Json string.
static String toJsonString(org.apache.hadoop.fs.MD5MD5CRC32FileChecksum checksum)
          Convert a MD5MD5CRC32FileChecksum to a Json string.
static String toJsonString(String key, Object value)
          Convert a key-value pair to a Json string.
static String toJsonString(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token)
          Convert a token object to a Json string.
static String toJsonString(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier>[] tokens)
          Convert a token object to a JSON string.
static org.apache.hadoop.hdfs.protocol.LocatedBlocks toLocatedBlocks(Map<?,?> json)
          Convert a Json map to LocatedBlock.
static org.apache.hadoop.fs.MD5MD5CRC32FileChecksum toMD5MD5CRC32FileChecksum(Map<?,?> json)
          Convert a Json map to a MD5MD5CRC32FileChecksum.
static org.apache.hadoop.ipc.RemoteException toRemoteException(Map<?,?> json)
          Convert a Json map to a RemoteException.
static org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> toToken(Map<?,?> m)
          Convert a Json map to a Token.
static List<org.apache.hadoop.security.token.Token<?>> toTokenList(Map<?,?> json)
          Convert a JSON map to a List>.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonUtil

public JsonUtil()
Method Detail

toJsonString

public static String toJsonString(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token)
                           throws IOException
Convert a token object to a Json string.

Throws:
IOException

toToken

public static org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> toToken(Map<?,?> m)
                                                                                                                  throws IOException
Convert a Json map to a Token.

Throws:
IOException

toDelegationToken

public static org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier> toDelegationToken(Map<?,?> json)
                                                                                                                                            throws IOException
Convert a Json map to a Token of DelegationTokenIdentifier.

Throws:
IOException

toJsonString

public static String toJsonString(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier>[] tokens)
                           throws IOException
Convert a token object to a JSON string.

Throws:
IOException

toTokenList

public static List<org.apache.hadoop.security.token.Token<?>> toTokenList(Map<?,?> json)
                                                                   throws IOException
Convert a JSON map to a List>.

Throws:
IOException

toJsonString

public static String toJsonString(Exception e)
Convert an exception object to a Json string.


toRemoteException

public static org.apache.hadoop.ipc.RemoteException toRemoteException(Map<?,?> json)
Convert a Json map to a RemoteException.


toJsonString

public static String toJsonString(String key,
                                  Object value)
Convert a key-value pair to a Json string.


toJsonString

public static String toJsonString(org.apache.hadoop.hdfs.protocol.HdfsFileStatus status,
                                  boolean includeType)
Convert a HdfsFileStatus object to a Json string.


toFileStatus

public static org.apache.hadoop.hdfs.protocol.HdfsFileStatus toFileStatus(Map<?,?> json,
                                                                          boolean includesType)
Convert a Json map to a HdfsFileStatus object.


toJsonString

public static String toJsonString(org.apache.hadoop.hdfs.protocol.LocatedBlocks locatedblocks)
                           throws IOException
Convert LocatedBlocks to a Json string.

Throws:
IOException

toLocatedBlocks

public static org.apache.hadoop.hdfs.protocol.LocatedBlocks toLocatedBlocks(Map<?,?> json)
                                                                     throws IOException
Convert a Json map to LocatedBlock.

Throws:
IOException

toJsonString

public static String toJsonString(org.apache.hadoop.fs.ContentSummary contentsummary)
Convert a ContentSummary to a Json string.


toContentSummary

public static org.apache.hadoop.fs.ContentSummary toContentSummary(Map<?,?> json)
Convert a Json map to a ContentSummary.


toJsonString

public static String toJsonString(org.apache.hadoop.fs.MD5MD5CRC32FileChecksum checksum)
Convert a MD5MD5CRC32FileChecksum to a Json string.


toMD5MD5CRC32FileChecksum

public static org.apache.hadoop.fs.MD5MD5CRC32FileChecksum toMD5MD5CRC32FileChecksum(Map<?,?> json)
                                                                              throws IOException
Convert a Json map to a MD5MD5CRC32FileChecksum.

Throws:
IOException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.