Package org.apache.thrift7

Examples of org.apache.thrift7.TSerializer


    }
  }

  private byte[] serializeTableDescriptor(TableDescriptor td) {
    try {
      TSerializer serializer = new TSerializer(new TJSONProtocol.Factory());
      return serializer.serialize(td);
    } catch (TException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here


              }
            });
           
            // Read objects
            assert thriftIn.hasNext();
            TBase base = thriftIn.read();
            assert base != null;
            StormTopology topology = (StormTopology) base;
            assert topology != null;
           
            return topology;
View Full Code Here

  /**
    * Reads the next object from the file.
    */
  public TBase read() throws IOException {
    TBase t = creator.create();
    try {
      t.read(binaryIn);
    } catch (TException e) {
      throw new IOException(e);
    }
    return t;
  }
View Full Code Here

    }

    public static <T> T thriftDeserialize(Class c, byte[] b) {
        try {
            T ret = (T) c.newInstance();
            TDeserializer des = threadDes.get();
            if (des == null) {
                des = new TDeserializer();
                threadDes.set(des);
            }
            des.deserialize((TBase) ret, b);
            return ret;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
       
View Full Code Here

    } catch (AlreadyAliveException e) {
      LOG.info(topologyname + " is already exist ");
      throw e;
    } catch (Throwable e) {
      LOG.info("Failed to check whether topology is alive or not", e);
      throw new TException(e);
    }
   
    int counter = data.getSubmittedCount().incrementAndGet();
    String topologyId = topologyname + "-" + counter + "-"
        + TimeUtils.current_time_secs();
View Full Code Here

    } catch (AlreadyAliveException e) {
      LOG.info("Fail to kill " + topologyname + " before restarting");
      return;
    } catch (Throwable e) {
      LOG.info("Failed to check whether topology is alive or not", e);
      throw new TException(e);
    }
   
    int counter = data.getSubmittedCount().incrementAndGet();
    String topologyId = topologyname + "-" + counter + "-"
        + TimeUtils.current_time_secs();
View Full Code Here

      LOG.error(errMsg, e);
      throw new NotAliveException(errMsg);
    } catch (Exception e) {
      String errMsg = "Failed to kill topology " + topologyName;
      LOG.error(errMsg, e);
      throw new TException(errMsg);
    }

  }
View Full Code Here

      LOG.error(errMsg, e);
      throw new NotAliveException(errMsg);
    } catch (Exception e) {
      String errMsg = "Failed to active topology " + topologyName;
      LOG.error(errMsg, e);
      throw new TException(errMsg);
    }

  }
View Full Code Here

      LOG.error(errMsg, e);
      throw new NotAliveException(errMsg);
    } catch (Exception e) {
      String errMsg = "Failed to deactivate topology " + topologyName;
      LOG.error(errMsg, e);
      throw new TException(errMsg);
    }

  }
View Full Code Here

      LOG.error(errMsg, e);
      throw new NotAliveException(errMsg);
    } catch (Exception e) {
      String errMsg = "Failed to rebalance topology " + topologyName;
      LOG.error(errMsg, e);
      throw new TException(errMsg);
    }

  }
View Full Code Here

TOP

Related Classes of org.apache.thrift7.TSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.