小编Rad*_*ika的帖子

获取IOException尝试使用ZipInputStream解压缩String值时,回推缓冲区已满

我试图解压缩String值.
但我得到一个java.io.IOException: Push back buffer is full:

public byte[] unzipArray(String stringToUnzip) {
            byte[] inputByteArray = Base64.decode(stringToUnzip);
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                        inputByteArray);
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

            ZipInputStream zipInputStream = new ZipInputStream(byteArrayInputStream);

            try {
                  ZipEntry theEntry = zipInputStream.getNextEntry();
            } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
            }
            byte[] buffer = new byte[2048];
            int size = 2048;

            while (true) {
                  try {
                        size = zipInputStream.read(buffer, 0, buffer.length);
                  } catch (IOException e) {
                        // TODO Auto-generated catch …
Run Code Online (Sandbox Code Playgroud)

java buffer ioexception zipinputstream

6
推荐指数
1
解决办法
3196
查看次数

XQuery - 如何在给定日期之前的90天前获得?

在xquery中,如何在给定日期之前90天获得?

说给定的日期是30-03-2012.我想获得在给定日期之前90天的日期.闰年计算也不容错过.

我找不到任何内置函数.有add/substract方法,但它只适用于两个日期.

有任何想法吗?

xquery

5
推荐指数
1
解决办法
4072
查看次数

Spring - 使用多动作控制器调用@modelattribute方法的顺序是什么

我有一个控制器,它有多个动作和相应的@modelattribute方法.输出方法之一是下一个方法的输入.然而,价值永远不会被设定.当我调试时,我发现调用方法的顺序不是我所期望的.它无论如何都与命令名称@ModelAttribute("nominationCommand")或方法名称有关.是什么驱使这个?

@ModelAttribute("awardCommand")
public AwardCommand getAwardList(HttpServletRequest request, HttpSession session, Model model) {

@ModelAttribute("associateDetails")
public List<AssociateDetailsCommand> getAssociateList (HttpServletRequest request, HttpSession session, Model model) {

@ModelAttribute("achievementCommand")
public AchievementDetailsCommand getAchievementDetails(HttpServletRequest request, Model model) {

@ModelAttribute("departmentCommand")
public List<DepartmentCommand> getDepartmentList(HttpServletRequest request,HttpSession session, Model model) {
Run Code Online (Sandbox Code Playgroud)

我需要按照上面列出的顺序调用方法.但是第三种方法在第二种方法之前被调用.需要你的帮助.

spring

3
推荐指数
1
解决办法
1270
查看次数

Cassandra 磁盘空间利用率高

我们在生产中有一个 12 节点的 cassandra 集群。最近,几乎所有节点都在使用高于 85% 的磁盘空间。我们尝试为几个表添加 default_time_to_live、gc_grace_seconds。但似乎对记录数或磁盘空间没有影响。有执行 nodetool 压缩和清理的建议。但这也提到不建议在生产环境中运行。

一些具体问题,

  1. 尝试将 TTL 设置为 100 天,将 gc 设置为 3 小时。期望是超过 90 天的记录应该在 3 小时后被删除。但它仍然完好无损。使用 TTL 设置删除超过 100 天的记录还有什么需要注意的吗?预计也将释放磁盘空间。删除记录后还应该做些什么来释放磁盘空间。
ALTER TABLE my_keyspace.my_item WITH default_time_to_live=8640000
ALTER TABLE my_keyspace.my_item WITH gc_grace_seconds=10800
Run Code Online (Sandbox Code Playgroud)
  1. 是否可以在所有实例使用超过 85% 的磁盘空间的生产环境中运行 nodetool compact 然后进行 nodetool 清理?

请分享其他建议,以释放 Cassandra 使用的磁盘空间。

Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address        Load       Tokens       Owns (effective)  Host ID                               Rack
UN  10.1.x.x  997.26 GiB  256          24.7%             erff8abf-16a1-4a72-b63e-5c4rg2c8d003  rack1
UN  10.2.x.x   1.22 TiB   256          26.1%             a8auuj76-f635-450f-a2fd-7sdfg0ss713e  rack1
UN  10.3.x.x   1.21 …
Run Code Online (Sandbox Code Playgroud)

space disk utilization cassandra

1
推荐指数
1
解决办法
59
查看次数