aliyun-openapi-java-sdk icon indicating copy to clipboard operation
aliyun-openapi-java-sdk copied to clipboard

RDS backups size greater than Integer.MAX_VALUE will fail

Open jolivares opened this issue 9 years ago • 4 comments

If my RDS backup size is greater than Integer.MAX_VALUE (2147483647) it fails because the library uses a integer to hold the size of the backup.

public class DescribeBackupsResponse extends AcsResponse {
31	
32		private String requestId;
33	
34		private String totalRecordCount;
…	
76		public Integer getTotalBackupSize() {
77			return this.totalBackupSize;
78		}
Caused by: java.lang.NumberFormatException: For input string: "14238202880"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:583)
	at java.lang.Integer.valueOf(Integer.java:766)
	at com.aliyuncs.transform.UnmarshallerContext.integerValue(UnmarshallerContext.java:37)
	at com.aliyuncs.rds.transform.v20140815.DescribeBackupsResponseUnmarshaller.unmarshall(DescribeBackupsResponseUnmarshaller.java:43)
	at com.aliyuncs.rds.model.v20140815.DescribeBackupsResponse.getInstance(DescribeBackupsResponse.java:467)
	at com.aliyuncs.rds.model.v20140815.DescribeBackupsResponse.getInstance(DescribeBackupsResponse.java:30)
	at com.aliyuncs.DefaultAcsClient.readResponse(DefaultAcsClient.java:220)
	at com.aliyuncs.DefaultAcsClient.parseAcsResponse(DefaultAcsClient.java:160)
	at com.aliyuncs.DefaultAcsClient.getAcsResponse(DefaultAcsClient.java:104)

jolivares avatar Jan 27 '17 10:01 jolivares

Hello, the problem belongs to the product category, you can directly mention the work orders and contact the product. Or join the nail group 11771185, convenient for us to find your product support, which is not very convenient in git, hope you understand.

ElaineFei avatar Jan 05 '18 08:01 ElaineFei

this is just a library bug, the library models a value as integer which can hold data bigger than integer.

flozano avatar Jan 05 '18 09:01 flozano

@jolivares @flozano thanks for your feedback, this is a bug we will fixs this soon

gaort avatar Jan 09 '18 12:01 gaort

@jolivares
Hi,Thank you very much for your feedback. Now the latest version 2.3.2 has fixed this problem, you can continue to use it.

public class DescribeBackupsResponse extends AcsResponse {

	private String requestId;

	private Long totalBackupSize;

        public Long getTotalBackupSize() {
		return this.totalBackupSize;
	}

        public static class Backup {

		private String backupId;

		private String dBInstanceId;

		private Long totalBackupSize;
    
                public Long getTotalBackupSize() {
			return this.totalBackupSize;
		}
       }
}

ssy352959096 avatar Feb 25 '19 03:02 ssy352959096