/** {@inheritDoc} */ @Override public boolean equals(Object obj) { if (null == obj) { return false; } if (obj == this) { return true; } if (!getClass().equals(obj.getClass())) { return false; } final FijiTable other = (FijiTable) obj; // Equal if the two tables have the same URI: return mTableURI.equals(other.getURI()); }
/** {@inheritDoc} */ @Override public boolean equals(Object obj) { if (null == obj) { return false; } if (obj == this) { return true; } if (!getClass().equals(obj.getClass())) { return false; } final Fiji other = (Fiji) obj; // Equal if the two instances have the same URI: return mURI.equals(other.getURI()); }
/** {@inheritDoc} */ @Override public boolean equals(Object obj) { if (null == obj) { return false; } if (obj == this) { return true; } if (!getClass().equals(obj.getClass())) { return false; } final FijiTable other = (FijiTable) obj; // Equal if the two tables have the same URI: return mTableURI.equals(other.getURI()); }
return false; } else if (!mTableUri.equals(other.mTableUri)) { return false;
@Override protected void validateFlags() throws Exception { // Parse --input and --output flags, --input is guaranteed to be a Fiji table: super.validateFlags(); Preconditions.checkArgument(!mProducerName.isEmpty(), "Specify a producer with --producer=..."); Preconditions.checkArgument(mNumThreadsPerMapper >= 1, "Illegal number of threads per mapper: {}, must", mNumThreadsPerMapper); Preconditions.checkArgument(getJobOutput() instanceof FijiTableMapReduceJobOutput, "Producer must output to a Fiji table but got {}.", getJobOutput().getClass().getName()); mOutput = (FijiTableMapReduceJobOutput) getJobOutput(); Preconditions.checkArgument( mOutput.getOutputTableURI().equals(getJobInputTable().getInputTableURI()), "Producer job output table {} does not match input table {}", mOutput.getOutputTableURI(), getJobInputTable().getInputTableURI()); }
/** {@inheritDoc} */ @Override protected void configureJob(Job job) throws IOException { final Configuration conf = job.getConfiguration(); // Construct the producer instance. if (null == mProducerClass) { throw new JobConfigurationException("Must specify a producer."); } // Serialize the producer class name into the job configuration. conf.setClass(FijiConfKeys.FIJI_PRODUCER_CLASS, mProducerClass, FijiProducer.class); // Write to the table, but make sure the output table is the same as the input table. if (!getInputTableURI().equals(mJobOutput.getOutputTableURI())) { throw new JobConfigurationException("Output table must be the same as the input table."); } // Producers should output to HFiles. mMapper = new ProduceMapper(); mReducer = new IdentityReducer<Object, Object>(); job.setJobName("Fiji produce: " + mProducerClass.getSimpleName()); mProducer = ReflectionUtils.newInstance(mProducerClass, job.getConfiguration()); mDataRequest = mProducer.getDataRequest(); // Configure the table input job. super.configureJob(job); }
/** {@inheritDoc} */ @Override public void applyPermissionsToNewTable(FijiURI tableURI) throws IOException { // The argument must be for a table in the instance this manages. Preconditions.checkArgument( FijiURI.newBuilder(mInstanceUri).withTableName(tableURI.getTable()).build() .equals(tableURI)); for (FijiUser user : listAllUsers()) { grantHTablePermissions(user.getName(), FijiManagedHBaseTableName .getFijiTableName(tableURI.getInstance(), tableURI.getTable()).toBytes(), getPermissions(user).toHBaseActions()); } }