예제 #1
0
 private ImportTable convert(InputDescription input) {
   assert input != null;
   BulkLoadImporterDescription desc = extract(input);
   LockType lockType;
   LockedOperation lockedOperation;
   switch (desc.getLockType()) {
     case CHECK:
       lockType = LockType.UNLOCKED;
       lockedOperation = LockedOperation.ERROR;
       break;
     case ROW:
       lockType = LockType.ROW;
       lockedOperation = LockedOperation.ERROR;
       break;
     case ROW_OR_SKIP:
       lockType = LockType.ROW;
       lockedOperation = LockedOperation.SKIP;
       break;
     case TABLE:
       lockType = LockType.TABLE;
       lockedOperation = LockedOperation.ERROR;
       break;
     case UNUSED:
       lockType = LockType.UNLOCKED;
       lockedOperation = LockedOperation.FORCE;
       break;
     default:
       throw new AssertionError(desc.getLockType());
   }
   return new ImportTable(
       desc.getModelType(),
       desc.getTableName(),
       desc.getColumnNames(),
       desc.getWhere(),
       desc.isCacheEnabled() ? Cache.ENABLED : Cache.DISABLED,
       lockType,
       lockedOperation,
       getInputLocation(input));
 }