Package org.apache.hdt.core.internal.hdfs

Examples of org.apache.hdt.core.internal.hdfs.HDFSFileStore


public class HadoopAdapterFactory implements IAdapterFactory {

  @Override
  public Object getAdapter(Object adaptableObject, Class adapterType) {
    if (adaptableObject instanceof HDFSFileStore) {
      HDFSFileStore fs = (HDFSFileStore) adaptableObject;
      if (adapterType == IPropertySource.class)
        return new HDFSFileStorePropertySource(fs);
    } else if (adaptableObject instanceof ZNode) {
      ZNode z = (ZNode) adaptableObject;
      return new ZNodePropertySource(z);
View Full Code Here


  /**
   * @param r
   */
  private void discardDownloadResource(IResource r) {
    try {
      HDFSFileStore store = (HDFSFileStore) EFS.getStore(r.getLocationURI());
      switch (r.getType()) {
      case IResource.FOLDER:
        IFolder folder = (IFolder) r;
        IResource[] members = folder.members();
        if (members != null) {
          for (int mc = 0; mc < members.length; mc++) {
            discardDownloadResource(members[mc]);
          }
        }
      case IResource.FILE:
        if (store.isLocalFile()) {
          File file = store.getLocalFile();
          HDFSManager.INSTANCE.startServerOperation(store.toURI().toString());
          try{
            if (file.exists()) {
              file.delete();
              UploadFileJob.deleteFoldersIfEmpty(file.getParentFile());
            }
            r.getParent().refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
          }finally{
            HDFSManager.INSTANCE.stopServerOperation(store.toURI().toString());
          }
        }
      }
    } catch (CoreException e) {
      MessageDialog.openError(targetPart.getSite().getShell(), "Upload HDFS Resources", "Error uploading resource to " + r.getLocationURI() + ": "
View Full Code Here

      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof IResource) {
          IResource r = (IResource) object;
          try {
            HDFSFileStore store = (HDFSFileStore) EFS.getStore(r.getLocationURI());
            enabled = store.isLocalFile();
          } catch (Throwable t) {
            enabled = false;
          }
        } else
          enabled = false;
View Full Code Here

      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof IResource) {
          IResource r = (IResource) object;
          try {
            HDFSFileStore store = (HDFSFileStore) EFS.getStore(r.getLocationURI());
            Permissions effectivePermissions = store.getEffectivePermissions();
            if (enabled && effectivePermissions != null && !effectivePermissions.write)
              enabled = false;
            if (enabled)
              enabled = store.isLocalFile();
          } catch (Throwable t) {
            enabled = false;
          }
        } else
          enabled = false;
View Full Code Here

      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof IResource) {
          IResource r = (IResource) object;
          try {
            HDFSFileStore store = (HDFSFileStore) EFS.getStore(r.getLocationURI());
            Permissions effectivePermissions = store.getEffectivePermissions();
            if (enabled && effectivePermissions != null && !effectivePermissions.read)
              enabled = false;
            if (enabled)
              enabled = !store.isLocalFile();
          } catch (Throwable t) {
            enabled = false;
          }
        } else
          enabled = false;
View Full Code Here

TOP

Related Classes of org.apache.hdt.core.internal.hdfs.HDFSFileStore

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.