Package org.springframework.data.hadoop.fs

Examples of org.springframework.data.hadoop.fs.FsShell


  public abstract FileSystem getFileSystem();

  protected void initializeCounterIfNecessary() throws IOException {
    if (!initialized) {
      FsShell fsShell = new FsShell(getFileSystem().getConf(), getFileSystem());

      if (getFileSystem().exists(new Path(getBasePath()))) {
        int maxCounter = 0;
        boolean foundFile = false;
        Collection<FileStatus> fileStats = fsShell.ls(this.getBasePath());
        for (FileStatus fileStatus : fileStats) {
          String shortName = fileStatus.getPath().getName();
          int counterFromName = getCounterFromName(shortName);
          if (counterFromName != -1) {
            foundFile = true;
          }
          if (counterFromName > maxCounter) {
            maxCounter = counterFromName;
          }
        }
        if (foundFile) {
          logger.debug("Found " + maxCounter + " existing files");
          this.setCounter(maxCounter + 1);
        }
      }
      else {
        logger.info("Creating base path " + getBasePath());
        fsShell.mkdir(getBasePath());
      }
      initialized = true;
    }
  }
View Full Code Here


  public abstract FileSystem getFileSystem();

  protected void initializeCounterIfNecessary() {
    if (!initialized) {
      FsShell fsShell = new FsShell(getFileSystem().getConf(), getFileSystem());
      int maxCounter = 0;
      boolean foundFile = false;
      Collection<FileStatus> fileStats = fsShell.ls(this.getBasePath());
      for (FileStatus fileStatus : fileStats) {
        String shortName = fileStatus.getPath().getName();
        int counterFromName = getCounterFromName(shortName);
        if (counterFromName != -1) {
          foundFile = true;
View Full Code Here

  }

  private void createFsShell(Configuration configuration) {
    Assert.notNull(configuration, "Hadoop Configuration must not be null.");
    this.configuration = configuration;
    fsShell = new FsShell(configuration);
  }
View Full Code Here

  @Override
  public final void onInit() {

    Assert.notNull(configuration, "Hadoop configuration must not be null");

    fsShell = new FsShell(configuration);

    this.evaluationContext.addPropertyAccessor(new MapAccessor());

    final BeanFactory beanFactory = this.getBeanFactory();
View Full Code Here

 
  public abstract FileSystem getFileSystem();
 
  protected void initializeCounterIfNecessary() {
    if (!initialized) {
      FsShell fsShell = new FsShell(getFileSystem().getConf(), getFileSystem());
      int maxCounter = 0;
      boolean foundFile = false;
      Collection<FileStatus> fileStats = fsShell.ls(this.getBasePath());
      for (FileStatus fileStatus : fileStats) {
        String shortName = fileStatus.getPath().getName();
        int counterFromName = getCounterFromName(shortName);
        if (counterFromName != -1) {
          foundFile = true;
View Full Code Here

 
  public abstract FileSystem getFileSystem();
 
  protected void initializeCounterIfNecessary() {
    if (!initialized) {
      FsShell fsShell = new FsShell(getFileSystem().getConf(), getFileSystem());
      int maxCounter = 0;
      boolean foundFile = false;
      Collection<FileStatus> fileStats = fsShell.ls(this.getBasePath());
      for (FileStatus fileStatus : fileStats) {
        String shortName = fileStatus.getPath().getName();
        int counterFromName = getCounterFromName(shortName);
        if (counterFromName != -1) {
          foundFile = true;
View Full Code Here

  }

  private void createFsShell(Configuration configuration) {
    Assert.notNull(configuration, "Hadoop Configuration must not be null.");
    this.configuration = configuration;
    fsShell = new FsShell(configuration);
  }
View Full Code Here

  @Override
  public final void onInit() {

    Assert.notNull(configuration, "Hadoop configuration must not be null");

    fsShell = new FsShell(configuration);

    this.evaluationContext.addPropertyAccessor(new MapAccessor());

    final BeanFactory beanFactory = this.getBeanFactory();
View Full Code Here

 
  public abstract FileSystem getFileSystem();
 
  protected void initializeCounterIfNecessary() {
    if (!initialized) {
      FsShell fsShell = new FsShell(getFileSystem().getConf(), getFileSystem());
      int maxCounter = 0;
      boolean foundFile = false;
      Collection<FileStatus> fileStats = fsShell.ls(this.getBasePath());
      for (FileStatus fileStatus : fileStats) {
        String shortName = fileStatus.getPath().getName();
        int counterFromName = getCounterFromName(shortName);
        if (counterFromName != -1) {
          foundFile = true;
View Full Code Here

TOP

Related Classes of org.springframework.data.hadoop.fs.FsShell

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.