Examples of HDFSServer


Examples of org.apache.hdt.core.internal.model.HDFSServer

      } catch (URISyntaxException e) {
      }
    }
    if (ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists())
      throw new CoreException(new Status(IStatus.ERROR, Activator.BUNDLE_ID, "Project with name '" + name + "' already exists"));
    HDFSServer hdfsServer = HadoopFactory.eINSTANCE.createHDFSServer();
    hdfsServer.setName(name);
    hdfsServer.setUri(hdfsURI.toString());
    hdfsServer.setLoaded(true);
    hdfsServer.setVersion(version);
    if (userId != null)
      hdfsServer.setUserId(userId);
    if (groupIds != null)
      for (String groupId : groupIds)
        hdfsServer.getGroupIds().add(groupId);
    getHdfsServers().add(hdfsServer);
    HadoopManager.INSTANCE.saveServers();
    uriToServerMap.put(hdfsServer.getUri(), hdfsServer);
    serverToProjectMap.put(hdfsServer, name);
    projectToServerMap.put(name, hdfsServer);
    createIProject(name, hdfsURI);
    return hdfsServer;
  }
View Full Code Here

Examples of org.apache.hdt.core.internal.model.HDFSServer

  }

  public HDFSServer getServer(String uri) {
    if (uri != null && !uriToServerCacheMap.containsKey(uri)) {
      String tmpUri = uri;
      HDFSServer serverU = uriToServerMap.get(tmpUri);
      while (serverU == null) {
        int lastSlashIndex = tmpUri.lastIndexOf('/');
        tmpUri = lastSlashIndex < 0 ? null : tmpUri.substring(0, lastSlashIndex);
        if (tmpUri != null)
          serverU = uriToServerMap.get(tmpUri + "/");
View Full Code Here

Examples of org.apache.hdt.core.internal.model.HDFSServer

  /**
   * @param string
   */
  public void startServerOperation(String uri) {
    HDFSServer server = getServer(uri);
    if (server != null && !server.getOperationURIs().contains(uri)) {
      server.getOperationURIs().add(uri);
    }
  }
View Full Code Here

Examples of org.apache.hdt.core.internal.model.HDFSServer

  /**
   * @param string
   */
  public void stopServerOperation(String uri) {
    HDFSServer server = getServer(uri);
    if (server != null) {
      server.getOperationURIs().remove(uri);
    }
  }
View Full Code Here

Examples of org.apache.hdt.core.internal.model.HDFSServer

      server.getOperationURIs().remove(uri);
    }
  }

  public boolean isServerOperationRunning(String uri) {
    HDFSServer server = getServer(uri);
    if (server != null) {
      return server.getOperationURIs().contains(uri);
    }
    return false;
  }
View Full Code Here

Examples of org.apache.hdt.core.internal.model.HDFSServer

   * @throws CoreException
   */
  public HDFSClient getClient(String serverURI,String hdfsVersion) throws CoreException {
    if (logger.isDebugEnabled())
      logger.debug("getClient(" + serverURI + "): Server=" + serverURI);
    HDFSServer server = getServer(serverURI);
    if (server != null && server.getStatusCode() == ServerStatus.DISCONNECTED_VALUE) {
      if (logger.isDebugEnabled())
        logger.debug("getClient(" + serverURI + "): Server timed out. Not returning client");
      throw new CoreException(new Status(IStatus.WARNING, Activator.BUNDLE_ID, "Server disconnected due to timeout. Please reconnect to server."));
    }
    if (hdfsClientsMap.containsKey(serverURI))
View Full Code Here

Examples of org.apache.hdt.core.internal.model.HDFSServer

      // Caller has to uncheck the 'Delete project contents' checkbox.
      if ((IResource.ALWAYS_DELETE_PROJECT_CONTENT & updateFlags) > 0) {
        throw new RuntimeException(
            "Deletion of HDFS project root folder is not supported. To remove project uncheck the \'Delete project contents on disk\' checkbox");
      }
      HDFSServer server = HDFSManager.INSTANCE.getServer(project.getLocationURI().toString());
      HDFSManager.INSTANCE.deleteServer(server);
    }
    return false;
  }
View Full Code Here

Examples of org.apache.hdt.core.internal.model.HDFSServer

      throw inE[0];
    if (interrupted) {
      // Tell HDFS manager that the server timed out
      if(logger.isDebugEnabled())
        logger.debug("executeWithTimeout(): Server timed out: "+serverURI);
      HDFSServer server = HDFSManager.INSTANCE.getServer(serverURI);
      String projectName = HDFSManager.INSTANCE.getProjectName(server);
      IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
      HDFSManager.disconnectProject(project);
      throw new InterruptedException();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.