Package org.apache.thrift7.transport

Examples of org.apache.thrift7.transport.TTransport


    }

    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

          Channels.newChannel(new FileOutputStream(libName)));
      LOG.info("Begin upload file from client to " + libName);
    } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      LOG.error("Fail to upload jar " + libName, e);
      throw new TException(e);
    }
  }
View Full Code Here

          Channels.newChannel(new FileOutputStream(fileLoc)));
      LOG.info("Begin upload file from client to " + fileLoc);
      return path;
    } catch (FileNotFoundException e) {
      LOG.error("File not found: " + fileLoc, e);
      throw new TException(e);
    } catch (IOException e) {
      LOG.error("Upload file error: " + fileLoc, e);
      throw new TException(e);
    }
  }
View Full Code Here

  public void uploadChunk(String location, ByteBuffer chunk)
      throws TException {
    TimeCacheMap<Object, Object> uploaders = data.getUploaders();
    Object obj = uploaders.get(location);
    if (obj == null) {
      throw new TException(
          "File for that location does not exist (or timed out) "
              + location);
    }
    try {
      if (obj instanceof WritableByteChannel) {
        WritableByteChannel channel = (WritableByteChannel) obj;
        channel.write(chunk);
        uploaders.put(location, channel);
      } else {
        throw new TException("Object isn't WritableByteChannel for "
            + location);
      }
    } catch (IOException e) {
      String errMsg = " WritableByteChannel write filed when uploadChunk "
          + location;
      LOG.error(errMsg);
      throw new TException(e);
    }

  }
View Full Code Here

TOP

Related Classes of org.apache.thrift7.transport.TTransport

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.