/** * @summary get the total ufs capacity in bytes, a negative value means the capacity is * unknown. * @return the response object * @deprecated since version 1.4 and will be removed in version 2.0 * @see #getInfo(Boolean) */ @GET @Path(GET_UFS_CAPACITY_BYTES) @ReturnType("java.lang.Long") @Deprecated public Response getUfsCapacityBytes() { return RestUtils.call(() -> getUfsCapacityInternal().getTotal(), ServerConfiguration.global()); }
/** * @summary get the free ufs capacity in bytes, a negative value means the capacity is unknown. * @return the response object * @deprecated since version 1.4 and will be removed in version 2.0 * @see #getInfo(Boolean) */ @GET @Path(GET_UFS_FREE_BYTES) @ReturnType("java.lang.Long") @Deprecated public Response getUfsFreeBytes() { return RestUtils.call(() -> { Capacity capacity = getUfsCapacityInternal(); if (capacity.getTotal() >= 0 && capacity.getUsed() >= 0 && capacity.getTotal() >= capacity .getUsed()) { return capacity.getTotal() - capacity.getUsed(); } return -1; }, ServerConfiguration.global()); }
/** * Checks if the two Capacity objects are equal. * * @param a the first Capacity object to be checked * @param b the second Capacity object to be checked */ private void checkEquality(Capacity a, Capacity b) { assertEquals(a.getTotal(), b.getTotal()); assertEquals(a.getUsed(), b.getUsed()); assertEquals(a, b); }
/** * @summary get the total ufs capacity in bytes, a negative value means the capacity is unknown. * @return the response object * @deprecated since version 1.4 and will be removed in version 2.0 * @see #getInfo(Boolean) */ @GET @Path(GET_UFS_CAPACITY_BYTES) @ReturnType("java.lang.Long") @Deprecated public Response getUfsCapacityBytes() { return RestUtils.call(() -> getUfsCapacityInternal().getTotal()); }
/** * @summary get the free ufs capacity in bytes, a negative value means the capacity is unknown. * @return the response object * @deprecated since version 1.4 and will be removed in version 2.0 * @see #getInfo(Boolean) */ @GET @Path(GET_UFS_FREE_BYTES) @ReturnType("java.lang.Long") @Deprecated public Response getUfsFreeBytes() { return RestUtils.call(() -> { Capacity capacity = getUfsCapacityInternal(); if (capacity.getTotal() >= 0 && capacity.getUsed() >= 0 && capacity.getTotal() >= capacity .getUsed()) { return capacity.getTotal() - capacity.getUsed(); } return -1; }); }