public int create(String path, @mode_t long mode, FuseFileInfo fi) { final AlluxioURI uri = mPathResolverCache.getUnchecked(path); final int flags = fi.flags.get(); LOG.trace("create({}, {}) [Alluxio: {}]", path, Integer.toHexString(flags), uri);
final int flags = fi.flags.get(); LOG.trace("open({}, 0x{}) [Alluxio: {}]", path, Integer.toHexString(flags), uri);
public Info(int width, int height, int subsampling, tjscalingfactor[] factors) { this.width = width; this.height = height; this.subsampling = subsampling; // The available sizes are determined from the list of scaling factors. this.availableSizes = Arrays.stream(factors) .filter(f -> f.denom.get() > 0) .sorted(Comparator.comparing(f -> -getScaled(width, f.num.get(), f.denom.get()))) .map(f -> new Dimension(getScaled(width, f.num.get(), f.denom.get()), getScaled(height, f.num.get(), f.denom.get()))) .filter(d -> d.width <= width && d.height <= height && d.width > 0 && d.height > 0) .distinct() .collect(Collectors.toList()); }
/** * Returns a java int representation of this field. * * @return a java int value for this field. */ @Override public final int intValue() { return get(); } }
static Protocol protocolFromNative(UnixProtoent p) { if (p == null) { return null; } List<String> emptyAliases = Collections.emptyList(); Pointer ptr; final Collection<String> aliases = ((ptr = p.aliases.get()) != null) ? StringUtil.getNullTerminatedStringArray(ptr) : emptyAliases; return new Protocol(p.name.get(), (short) p.proto.get(), aliases); }
static Service serviceFromNative(UnixServent s) { if (s == null) { return null; } List<String> emptyAliases = Collections.emptyList(); Pointer ptr; final Collection<String> aliases = ((ptr = s.aliases.get()) != null) ? StringUtil.getNullTerminatedStringArray(ptr) : emptyAliases; return new Service(s.name.get(), ntohs(s.port.get()), s.proto.get(), aliases); }
@Override public boolean works() { final long value = currentTimeMicros(); final Timeval timeval = new Timeval(this.runtime); this.libc.gettimeofday(timeval, null); return value > 0 && timeval.tv_usec.get() < MILLION; }
@Override public long currentTimeMicros() { final Timeval timeval = new Timeval(this.runtime); this.libc.gettimeofday(timeval, null); return timeval.tv_sec.get() * MILLION + timeval.tv_usec.get(); }
/** * Returns a java int representation of this field. * * @return a java int value for this field. */ @Override public final int intValue() { return get(); } }
/** * Returns a java int representation of this field. * * @return a java int value for this field. */ @Override public final int intValue() { return get(); } }