org.apache.nutch.util

## Class TableUtil

- java.lang.Object
- - org.apache.nutch.util.TableUtil

-     public class TableUtil
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.nio.ByteBuffer` | `YES_VAL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TableUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getReversedHost(java.lang.String reversedUrl)` Given a reversed url, returns the reversed host E.g "com.foo.bar:http:8983/to/index.html?a=b" -> "com.foo.bar"
    `static java.lang.String` | `reverseHost(java.lang.String hostName)`
    `static java.lang.String` | `reverseUrl(java.lang.String urlString)` Reverses a url's domain.
    `static java.lang.String` | `reverseUrl(java.net.URL url)` Reverses a url's domain.
    `static java.lang.String` | `toString(java.lang.CharSequence utf8)` Convert given Utf8 instance to String and and cleans out any offending "�" from the String.
    `static java.lang.String` | `unreverseHost(java.lang.String reversedHostName)`
    `static java.lang.String` | `unreverseUrl(java.lang.String reversedUrl)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### YES_VAL

          public static final java.nio.ByteBuffer YES_VAL

  - ### Constructor Detail

    - #### TableUtil

          public TableUtil()

  - ### Method Detail

    - #### reverseUrl

          public static java.lang.String reverseUrl(java.lang.String urlString)
                                             throws java.net.MalformedURLException

      Reverses a url's domain. This form is better for storing in hbase. Because scans within the same domain are faster.

      E.g. "http://bar.foo.com:8983/to/index.html?a=b" becomes "com.foo.bar:8983:http/to/index.html?a=b".

      Parameters:
        `urlString` - url to be reversed
      Returns:
        Reversed url
      Throws:
        `java.net.MalformedURLException`

    - #### reverseUrl

          public static java.lang.String reverseUrl(java.net.URL url)

      Reverses a url's domain. This form is better for storing in hbase. Because scans within the same domain are faster.

      E.g. "http://bar.foo.com:8983/to/index.html?a=b" becomes "com.foo.bar:http:8983/to/index.html?a=b".

      Parameters:
        `url` - url to be reversed
      Returns:
        Reversed url

    - #### unreverseUrl

          public static java.lang.String unreverseUrl(java.lang.String reversedUrl)

    - #### getReversedHost

          public static java.lang.String getReversedHost(java.lang.String reversedUrl)

      Given a reversed url, returns the reversed host E.g "com.foo.bar:http:8983/to/index.html?a=b" -> "com.foo.bar"
      Parameters:
        `reversedUrl` - Reversed url
      Returns:
        Reversed host

    - #### reverseHost

          public static java.lang.String reverseHost(java.lang.String hostName)

    - #### unreverseHost

          public static java.lang.String unreverseHost(java.lang.String reversedHostName)

    - #### toString

          public static java.lang.String toString(java.lang.CharSequence utf8)

      Convert given Utf8 instance to String and and cleans out any offending "�" from the String.
      Parameters:
        `utf8` - Utf8 object
      Returns:
        string-ifed Utf8 object or null if Utf8 instance is null

Copyright © 2019 The Apache Software Foundation