Package org.apache.flink.runtime.ipc

Examples of org.apache.flink.runtime.ipc.Server$Connection


     * Check if we can connect using password auth
     * @return true|false
     */
    public boolean checkPasswordAuth() {
        boolean status = false;
        Connection c = null;
        try {
            c = new Connection(host, port);
            c.connect();
            if(logger.isLoggable(Level.FINER)) {
                logger.finer("Checking connection...");
            }
            status = c.authenticateWithPassword(userName, password);
            if (status) {
                logger.finer("Successfully connected to " + userName + "@" + host + " using password authentication");
            }
        } catch(IOException ioe) {
            //logger.printExceptionStackTrace(ioe);
            if (logger.isLoggable(Level.FINER)) {
                ioe.printStackTrace();
            }
        } finally {
            c.close();
        }
        return status;
    }
View Full Code Here


     */
    private void openConnection() throws IOException {

    boolean isAuthenticated = false;
    String message= "";
    connection = new Connection(host, port);

        connection.connect(new HostVerifier(knownHostsDatabase));
        if(SSHUtil.checkString(keyFile) == null && SSHUtil.checkString(password) == null &&
                privateKey == null) {
            message += "No key or password specified - trying default keys \n";
View Full Code Here

   /**
    * Returns a new connection.
    */
   Connection getConnection()
   {
      return new Connection(getAccessKeyId(), getSecretAccessKey(),
            isSecure(), getServer(), getPort(), getCallingFormat());
   }
View Full Code Here

   /**
    * Returns a new connection.
    */
   Connection getConnection()
   {
      return new Connection(getAccessKeyId(), getSecretAccessKey(),
            isSecure(), getServer(), getPort(), getCallingFormat());
   }
View Full Code Here

    final int handlerCount = GlobalConfiguration.getInteger(RPC_NUM_HANDLER_KEY, DEFAULT_NUM_HANLDER);
    final int rpcPort = GlobalConfiguration.getInteger(ProfilingUtils.JOBMANAGER_RPC_PORT_KEY,
      ProfilingUtils.JOBMANAGER_DEFAULT_RPC_PORT);
   
    final InetSocketAddress rpcServerAddress = new InetSocketAddress(jobManagerbindAddress, rpcPort);
    Server profilingServerTmp = null;
    try {

      profilingServerTmp = RPC.getServer(this, rpcServerAddress.getHostName(), rpcServerAddress.getPort(),
        handlerCount);
      profilingServerTmp.start();
    } catch (IOException ioe) {
      throw new ProfilingException("Cannot start profiling RPC server: " + StringUtils.stringifyException(ioe));
    }
    this.profilingServer = profilingServerTmp;
View Full Code Here

    private void connectionClosed() {
        if(! reconnect.get()) {
            return; // Nothing to do
        }
        // Wait until the connection is closed before reconnecting
        final Connection connection = this.connection;
        if(connection != null) {
            if(channel == null) {
                connection.closeAsync();
            }
        } else {
            HostControllerLogger.ROOT_LOGGER.lostRemoteDomainConnection();
            executorService.execute(new Runnable() {
                @Override
View Full Code Here

     *
     * @param connectionURI the new connection URI
     */
    protected void reconfigure(final URI connectionURI) {
        configuration.setUri(connectionURI);
        final Connection connection = this.connection;
        if(connection != null) {
            connection.closeAsync();
        }
    }
View Full Code Here

            builder.set(Options.SASL_MECHANISMS, Sequence.of("JBOSS-LOCAL-USER"));
        }

        final IoFuture<Connection> futureConnection = endpoint.connect(connectionURI, builder.getMap(), new AuthenticationCallbackHandler(username, password));
        // wait for the connection to be established
        final Connection connection = IoFutureHelper.get(futureConnection, 5000, TimeUnit.MILLISECONDS);
        // create a remoting EJB receiver for this connection
        final EJBReceiver receiver = new RemotingConnectionEJBReceiver(connection);
        // associate it with the client context
        EJBClientContext context = EJBClientContext.create();
        context.registerEJBReceiver(receiver);
View Full Code Here

        return this.nodeName;
    }

    @Override
    public EJBReceiver getEJBReceiver() {
        Connection connection;
        final ReconnectHandler reconnectHandler;
        OptionMap channelCreationOptions = OptionMap.EMPTY;
        final EJBClientConfiguration ejbClientConfiguration = this.clusterContext.getEJBClientContext().getEJBClientConfiguration();
        try {
            // if the client configuration is available create the connection using those configs
View Full Code Here

            this.connectionTimeout = connectionTimeoutInMillis;
        }

        @Override
        public void reconnect() throws IOException {
            Connection connection = null;
            try {
                final IoFuture<Connection> futureConnection = NetworkUtil.connect(endpoint, destinationHost, destinationPort, null, connectionCreationOptions, callbackHandler, null);
                connection = IoFutureHelper.get(futureConnection, connectionTimeout, TimeUnit.MILLISECONDS);
                logger.debug("Successfully reconnected to connection " + connection);
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.ipc.Server$Connection

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.