Search in sources :

Example 6 with InvalidPathException

use of org.apache.hadoop.fs.InvalidPathException in project hadoop by apache.

the class TestINodeFile method testInvalidSymlinkTarget.

private void testInvalidSymlinkTarget(NamenodeProtocols nnRpc, String invalidTarget, String link) throws IOException {
    try {
        FsPermission perm = FsPermission.createImmutable((short) 0755);
        nnRpc.createSymlink(invalidTarget, link, perm, false);
        fail("Symbolic link creation of target " + invalidTarget + " should fail");
    } catch (InvalidPathException expected) {
    // Expected
    }
}
Also used : FsPermission(org.apache.hadoop.fs.permission.FsPermission) InvalidPathException(org.apache.hadoop.fs.InvalidPathException)

Example 7 with InvalidPathException

use of org.apache.hadoop.fs.InvalidPathException in project carbondata by apache.

the class CarbonInputFormat method populateCarbonTable.

/**
   * this method will read the schema from the physical file and populate into CARBON_TABLE
   * @param configuration
   * @throws IOException
   */
private static void populateCarbonTable(Configuration configuration) throws IOException {
    String dirs = configuration.get(INPUT_DIR, "");
    String[] inputPaths = StringUtils.split(dirs);
    if (inputPaths.length == 0) {
        throw new InvalidPathException("No input paths specified in job");
    }
    AbsoluteTableIdentifier absoluteTableIdentifier = AbsoluteTableIdentifier.fromTablePath(inputPaths[0]);
    // read the schema file to get the absoluteTableIdentifier having the correct table id
    // persisted in the schema
    CarbonTable carbonTable = SchemaReader.readCarbonTableFromStore(absoluteTableIdentifier);
    setCarbonTable(configuration, carbonTable);
}
Also used : CarbonTable(org.apache.carbondata.core.metadata.schema.table.CarbonTable) AbsoluteTableIdentifier(org.apache.carbondata.core.metadata.AbsoluteTableIdentifier) InvalidPathException(org.apache.hadoop.fs.InvalidPathException)

Aggregations

InvalidPathException (org.apache.hadoop.fs.InvalidPathException)7 FsPermission (org.apache.hadoop.fs.permission.FsPermission)3 NamenodeProtocols (org.apache.hadoop.hdfs.server.protocol.NamenodeProtocols)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 IOException (java.io.IOException)1 URI (java.net.URI)1 AbsoluteTableIdentifier (org.apache.carbondata.core.metadata.AbsoluteTableIdentifier)1 CarbonTable (org.apache.carbondata.core.metadata.schema.table.CarbonTable)1 Configuration (org.apache.hadoop.conf.Configuration)1 CreateFlag (org.apache.hadoop.fs.CreateFlag)1 FSDataOutputStream (org.apache.hadoop.fs.FSDataOutputStream)1 FileEncryptionInfo (org.apache.hadoop.fs.FileEncryptionInfo)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 ParentNotDirectoryException (org.apache.hadoop.fs.ParentNotDirectoryException)1 Path (org.apache.hadoop.fs.Path)1 HdfsFileStatus (org.apache.hadoop.hdfs.protocol.HdfsFileStatus)1 SnapshotAccessControlException (org.apache.hadoop.hdfs.protocol.SnapshotAccessControlException)1 EncryptionKeyInfo (org.apache.hadoop.hdfs.server.namenode.FSDirEncryptionZoneOp.EncryptionKeyInfo)1 BlocksMapUpdateInfo (org.apache.hadoop.hdfs.server.namenode.INode.BlocksMapUpdateInfo)1 StandbyException (org.apache.hadoop.ipc.StandbyException)1