Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Adding ListViewItem from text changed event in Kotlin

If user types in ListViewItem text: "Add new item". I want to add a new item. My DataSet and Adapter below: sssssssssssssssssssssssss sssssssssssssssssssssssss

//classes
class DataModel internal constructor(
    var checked: Boolean,
    var itemDesc: String?
)

class CustomAdapter(private val dataSet: ArrayList<*>, mContext: Context) :
    ArrayAdapter<Any?>(mContext, R.layout.layout2, dataSet)
{
    private class ViewHolder {
        lateinit var checkBox: CheckBox
        lateinit var textInput: TextView
    }

    override fun getCount(): Int {
        return dataSet.size
    }

    override fun getItem(position: Int): DataModel {
        return dataSet[position] as DataModel
    }

    override fun getView(
        position: Int,
        convertView: View?,
        parent: ViewGroup
    ): View
    {
        var convertView = convertView
        val viewHolder: ViewHolder
        val result: View

        if (convertView == null) {
            viewHolder = ViewHolder()

            convertView =
                LayoutInflater.from(parent.context).inflate(R.layout.layout2, parent, false)
            viewHolder.checkBox =
                convertView.findViewById(R.id.checkBox)
            viewHolder.textInput =
                convertView.findViewById(R.id.textInput)

            result = convertView
            convertView.tag = viewHolder
        } else
        {
            viewHolder = convertView.tag as ViewHolder
            result = convertView
        }

How to do such task? sssssssssssssssssss sssssssssssssssssss

Jackson serializing objects with circular reference

Is it possible to access or lookup annotation values that were placed on an object when using a custom serializer?


data class Parent(
  val name: String,
  @JsonIgnoreProperties("parent") 
  val child: Child
)
data class Child(
  val name: String,
  val parent: Parent,
)

class CustomSerializer : StdSerializer<Child>(Child::class.java) {
  override fun serialize(obj: Child, gen: JsonGenerator, provider: SerializerProvider) {
     gen.writeStartObject()
     gen.writeFieldName("name")
     gen.writeString(obj.name)
     // if i am serializing a child that is accessed from within a parent object
     // that should not be serialized because of @JsonIgnoreProperties
     // but if I am serializing a Child directly, the parent should be serialized
     gen.writeEndObject()
  }
}

Dependency alias 'androidx-material3-adaptive-navigation-suite' is not used in build scripts

I'm trying to implement the Navigation Suite library provided by Material Design 3 for my Jetpack Compose Project but after several gradle syncs, a warning won't go away.

build.gradle.kts (:app)

plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.jetbrainsKotlinAndroid)
}

android {
    namespace = "com.plaireapps.demonavigationsuite"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.plaireapps.demonavigationsuite"
        minSdk = 30
        targetSdk = 34
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary = true
        }
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
    buildFeatures {
        compose = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.1"
    }
    packaging {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
}

dependencies {

    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.lifecycle.runtime.ktx)
    implementation(libs.androidx.activity.compose)
    implementation(platform(libs.androidx.compose.bom))
    implementation(libs.androidx.ui)
    implementation(libs.androidx.ui.graphics)
    implementation(libs.androidx.ui.tooling.preview)
    implementation(libs.androidx.material3)
    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)
    androidTestImplementation(platform(libs.androidx.compose.bom))
    androidTestImplementation(libs.androidx.ui.test.junit4)
    debugImplementation(libs.androidx.ui.tooling)
    debugImplementation(libs.androidx.ui.test.manifest)
}

libs.versions.toml

[versions]
agp = "8.3.2"
kotlin = "1.9.0"
coreKtx = "1.13.0"
junit = "4.13.2"
junitVersion = "1.1.5"
espressoCore = "3.5.1"
lifecycleRuntimeKtx = "2.7.0"
activityCompose = "1.9.0"
composeBom = "2024.04.01"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-material3-adaptive-navigation-suite = { module = "androidx.compose.material3:material3-adaptive-navigation-suite-android", version = "1.0.0-alpha06" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

Warning returned

Dependency alias 'androidx-material3-adaptive-navigation-suite' is not used in build scripts

BasticTextField2 does not show keyboard again after hiding it

I'm facing this issue. Using the new BasicTextField2 API, after hiding the keyboard with the back key of the Android navigation bar and trying to show it again by pressing on the BasicTextField2, the keyboard does not show again. I was going to fix this issue by showing the keyboard programatically but it seems that BasicTextField2 does not detect pressed events.

// Compose
var value by remember {
    mutableStateOf("")
}
val interactionSource = remember {
    MutableInteractionSource()
}

val pressed by interactionSource.collectIsPressedAsState()
val focused by interactionSource.collectIsFocusedAsState()

Log.d("CustomTextFieldEvents", "----------------------------")
Log.d("CustomTextFieldEvents: ", "Pressed: $pressed")
Log.d("CustomTextFieldEvents: ", "Focused: $focused")
Log.d("CustomTextFieldEvents", "----------------------------")

BasicTextField2(
    modifier = modifier,
    value = value,
    onValueChange = { newValue ->
        value = newValue
    },
    interactionSource = interactionSource
)

I only get in the logcat when I tap on it:

CustomTextFieldEvents   com.marmatsan.app                    D  ----------------------------
CustomTextFieldEvents:  com.marmatsan.app                    D  Pressed: false
CustomTextFieldEvents:  com.marmatsan.app                    D  Focused: true
CustomTextFieldEvents   com.marmatsan.app                    D  ----------------------------

Changing it with the old BasicTextField works. What am I doing wrong? Thank you.

How can I retrieve the current duration from the Media Player to display on the song progress bar?

i have tried every possible step but only giving value once, i want it should update every single second. this is my code, where i'm doing wrong?

i want to impliment progress slider for musics, any one please can help me?

here I'm using a slider library which you this library accept range from current position to total duration.

data class MusicPlayerStates(
    var playingSongCurrentPosition: MutableState<Int> = mutableIntStateOf(0),
    var playingSongDuration: MutableState<Int> = mutableIntStateOf(0),
    
    //other code
)

fun onEvent(event: MusicPlayerUiEvents) {
        when (event) {

            is MusicPlayerUiEvents.PlaySong -> {
                mediaPlayer?.let {
                    if (it.isPlaying) {
                        mediaPlayer?.stop()
                        mediaPlayer?.reset()
                        _musicPlayerState.update { state ->
                            state.copy(
                                playingSongCurrentPosition = state.playingSongCurrentPosition.apply {
                                    this.value = 0
                                },
                                playingSongDuration = state.playingSongDuration.apply {
                                    this.value = 0
                                }
                            )
                        }
                    }
                }
                _musicPlayerState.update {
                    it.copy(
                        isSongPlaying = it.isSongPlaying.apply {
                            this.value = true
                        }
                    )
                }
                mediaPlayer?.release()
                mediaPlayer = MediaPlayer().apply {
                    setDataSource(event.url)
                    prepareAsync()
                }
                mediaPlayer?.setOnPreparedListener { mediaPlayer ->
                    mediaPlayer.seekTo(state.value.playingSongCurrentPosition.value)
                    mediaPlayer.start()
                    setSongDuration(mediaPlayer.duration)
                    updatePlaybackState(mediaPlayer.currentPosition)
                    
               Log.d("check for currentD_VM","${state.value.playingSongCurrentPosition.value}")
                }

                mediaPlayer?.setOnCompletionListener { mediaPlayer ->
                    // Use for precise updates
                    mediaPlayer?.stop()
                    _musicPlayerState.update { state ->
                        state.copy(
                            playingSongCurrentPosition = state.playingSongCurrentPosition.apply {
                                this.value = 0
                            },
                            playingSongDuration = state.playingSongDuration.apply {
                                this.value = 0
                            },
                            isSongPlaying = state.isSongPlaying.apply {
                                this.value = false
                            },
                        )
                    }
                }

            }
            }
         }
     }
    private fun updatePlaybackState(currentPosition: Int) {
        _musicPlayerState.update {
            it.copy(
                playingSongCurrentPosition = it.playingSongCurrentPosition.apply {
                    this.value = currentPosition
                }
            )
        }
    }

    private fun setSongDuration(duration: Int) {
        _musicPlayerState.update {
            it.copy(
                playingSongDuration = it.playingSongDuration.apply {
                    this.value = duration
                }
            )
        }
    }
 Box(
            modifier =
            Modifier
                .padding(vertical = 80.dp, horizontal = 20.dp)
                .fillMaxWidth()
                .height(20.dp)
        ) {
            var fraction by remember { mutableFloatStateOf(1f) }
            WavySlider(
                valueRange = 1000f..state.playingSongDuration.value.toFloat(),
                value = 1000f,
                onValueChange = { },
                waveLength = 25.dp,     // Set this to 0.dp to get a regular Slider
                waveHeight = 10.dp,     // Set this to 0.dp to get a regular Slider
                waveVelocity = 15.dp to WaveDirection.HEAD, // Speed per second and its direction
                waveThickness = 4.dp,   // Defaults to the specified trackThickness
                trackThickness = 4.dp,  // Defaults to 4.dp, same as regular Slider
                incremental = false,    // Whether to gradually increase waveHeight
                // animationSpecs = ... // Customize various animations of the wave
            )
        }

How to redirect to Play store using App Links if app not installed in Android?

I am using the concept of deep linking in my app & have to integrate deep linking tool without any pricing. for this i am using App links in Android and successfully able to integrate it as well when i share the link from my app its working fine it goes to the destination in app

but problem is when a user is not having app installed this link is opening through phone's browser and error is displayed of not found but i want to go to the play store if app is not installed. what approach should i try.

or please suggest any free 3rd party tool to implement the same functionality

Thanks in advance!!

Update gradle: An annotation argument must be a compile-time constant [closed]

android com.android.tools.build:gradle:7.4.2 upgrade to 8.3.2 annotation class not work kotlin version:1.9.23 Android Studio Iguana | 2023.2.1 Patch 2 compile SDK = 34

my annotation class:

@Target(AnnotationTarget.CLASS) @Retention(AnnotationRetention.RUNTIME) annotation class ViewHolderLayout(val id: Int)

viewHolder class:

@ViewHolderLayout(R.layout.layout_workout_filter_item) class WorkoutFilterItemViewHolder(
view: View,
private val listener: GeneralClickListener ) : RecyclerView.ViewHolder(view) {

private val tvItem = view.findViewById<TextView>(R.id.tvWorkoutFilterItem)

@ViewHolderBinder
fun bind(data: ExerciseInstructionTag) {

   

    tvItem.setOnClickListener {
        listener.onItemHolderClicked(this::class.java.name, data)
    }
} }

logcat:

Task :app:kaptProductionDebugKotlin FAILED /Users/aaa/AndroidStudioProjects/project/app/build/tmp/kapt3/stubs/productionDebug/ir//teaching/workout/adapter/holder/WorkoutFilterItemViewHolder.java:8: error: incompatible types: cannot be converted to int @.features.base.util.ViewHolderLayout(id = null)

Should modifiers be written in uppercase or lowercase: What's the preferred convention?

We've hit a snag in our project discussion about whether the injected parameter modifier should affect just the top-level component or all components. Could you provide any input?

@Composable
fun HomeScreen(
    modifier: Modifier = Modifier,
    homeViewModel: HomeViewModel = viewModel(),
    navigateToGoalReading: () -> Unit,
    navigateToDetailEvent: () -> Unit,
) {
    val titleTextState by homeViewModel.titleTextState.collectAsState()
    val contentTextState by homeViewModel.contentTextState.collectAsState()
    val goalBookRead by homeViewModel.goalBookRead.collectAsState()
    val readingGoalGraphDataList by homeViewModel.goalReadingGraphDataList.collectAsState()
    val bookKingOfTheMonthDataList by homeViewModel.bookKingOfTheMonthDataList.collectAsState()

    MindWayAndroidTheme { colors, _ ->
        Column(
            verticalArrangement = Arrangement.spacedBy(20.dp, Alignment.Top),
            horizontalAlignment = Alignment.CenterHorizontally,
            modifier = modifier
                .background(color = colors.WHITE)
                .fillMaxSize()
                .padding(horizontal = 24.dp)
        ) {
            HomeNoticeCard(
                titleText = titleTextState,
                content = contentTextState,
                onClick = navigateToDetailEvent,
                modifier = Modifier
                    .height(100.dp)
                    .fillMaxWidth(),
            )
            HomeGoalReadingChart(
                readNumberList = readingGoalGraphDataList,
                onClick = navigateToGoalReading,
                goalBookRead = goalBookRead,
                modifier = Modifier
                    .fillMaxWidth()
                    .height(211.dp),
            )
            HomeReadersOfTheMonthChart(
                bookKingOfTheMonthData = bookKingOfTheMonthDataList,
                modifier = Modifier
                    .height(239.dp)
                    .fillMaxWidth(),
            )
        }
    }
}

VS

@Composable
fun HomeScreen(
    modifier: Modifier = Modifier,
    homeViewModel: HomeViewModel = viewModel(),
    navigateToGoalReading: () -> Unit,
    navigateToDetailEvent: () -> Unit,
) {
    val titleTextState by homeViewModel.titleTextState.collectAsState()
    val contentTextState by homeViewModel.contentTextState.collectAsState()
    val goalBookRead by homeViewModel.goalBookRead.collectAsState()
    val readingGoalGraphDataList by homeViewModel.goalReadingGraphDataList.collectAsState()
    val bookKingOfTheMonthDataList by homeViewModel.bookKingOfTheMonthDataList.collectAsState()

    MindWayAndroidTheme { colors, _ ->
        Column(
            verticalArrangement = Arrangement.spacedBy(20.dp, Alignment.Top),
            horizontalAlignment = Alignment.CenterHorizontally,
            modifier = modifier
                .background(color = colors.WHITE)
                .fillMaxSize()
                .padding(horizontal = 24.dp)
        ) {
            HomeNoticeCard(
                titleText = titleTextState,
                content = contentTextState,
                onClick = navigateToDetailEvent,
                modifier = modifier
                    .height(100.dp)
                    .fillMaxWidth(),
            )
            HomeGoalReadingChart(
                readNumberList = readingGoalGraphDataList,
                onClick = navigateToGoalReading,
                goalBookRead = goalBookRead,
                modifier = modifier
                    .fillMaxWidth()
                    .height(211.dp),
            )
            HomeReadersOfTheMonthChart(
                bookKingOfTheMonthData = bookKingOfTheMonthDataList,
                modifier = modifier
                    .height(239.dp)
                    .fillMaxWidth(),
            )
        }
    }
}

I have looked into 'now in android' and Chris Banes' article 'Always provide a Modifier parameter', as well as Google Open Source's 'API Guidelines for Jetpack Compose', but I couldn't find a convincing answer. I would greatly appreciate a definitive answer. Thank you

JobRunr: Disable NoSQL Storage Configuration

I am using the jobrunr-spring-boot-3-starter, version 7.0.0-RC.1, and have a PostgreSQL database set up - which is picked up as the default storage provider by JobRunr.

Now, I have added a Redis integration (via Lettuce), and JobRunr has started picking it up as the default storage, which I don't want.

I haven't applied any custom configuration to JobRunr. What is the best approach to force JobRunr to stick with the PostgreSQL datasource?

Construct this flow from local and remote sources

I'm struggling to create a flow that satisfies the conditions commonly found in offline supported apps.

1.if local results exist, emit those first. 2.then emit remote results. 3.persist remote results into Room. 4.an exception should be emitted if there were 0 emissions. So in practice suppose

  1. If local query returns no results, either because it's an initial call or due to an error, try the network.
  2. If the network fails, throw an exception. Otherwise emit the network results.
  3. If local query returns results, emit.
  4. fetch from the network and either emit results or fail silently.

A failure should be thrown iff both local and remote sources lack results.

Something like

var localResults = emptyList<Movie>()
flow {
    localResults = localSrc.getMovies()
    if (localResults.isNotEmpty()) emit(localResults)
    try {
        val remoteResults = remoteSrc.getMovies()
        localSrc.insert(remoteResults)
        emit(remoteResults)
    } catch (ex: Exception) {
      if (localResults.isEmpty()) throw IllegalStateException()
    }
}
  

If localSrc.getMovies() fails it throws an exception but I want to resume fetching from remote because it may be produce some results.

Edit: Solution

suspend fun getMoviesFlow(id: String): Flow<List<Movie>> {
        var fromLocal = emptyList<Movie>()
        return flow {
            try {
                fromLocal = localDataSource.getMovies().map { it.toDomain() }
                if (fromLocal.isNotEmpty()) emit(fromLocal)
            } catch (localEx: Exception) {
                // so you can resume to a network emission
            }
            try {
                val fromNetwork = fromNetwork(id)
                emit(fromNetwork)
            } catch (remoteEx: Exception) {
                if (fromLocal.isEmpty()) throw IllegalStateException(
                    "fail to fetch movies"
                )
            }
        }
    }

To broot. "fromLocal" is a local variable so it wouldnt be shared amongst multiple invocations to getMoviesFlow(id), but I could put it in the flow and my results would be the same.

Converting an existing module to dynamic module caused data loss, after update looks like fresh installed app with no data, lost all the datas

My Android app have 5 modules previously, I converted one of them to dynamic module and pushed new aab to playstore (version code = n). So now my app have 4 normal module and 1 dynamic module but the issue is, after updating to this app version the app datas are all cleared (shared preferences). It seems like a fresh install. When a user with app version code < n loss all their data after updating to version n.

Cross checked with goolge documentation, but still have the issue

how to serialize Any in Kotlin?

how can I serialize below data? This is AppConfig and value of value could be any type and I can't use Any for serialization.

[
 {
    "key": "PROFILE_PHOTO",
    "value": "url"
  },
  {
    "key": "RELATIONSHIP",
    "value": 0.6
  },
  {
    "key": "SEX",
    "value": [ "Man", "Woman"]
  },
  {
    "key": "IOS_VER",
    "value": 5
  }
]

JanusGraph gremlin crashes when adding many history properties

I am adding a vertex with a very large number of properties (17 properties and 1500 history entries in each). At first, there was a recursion error at startup. I fixed it, took out the next() method separately. Now he writes another error. Sometimes, it turns out to load from the second or third time on top of the previous times with an error. How can I fix it?

fun createNodeHistory(
        listOntologyTags: List<String>,
        propertiesHistory: List<PropertyHistory>,
        mandatoryLevel: Byte,
        listNonHierarchicalLevels: List<Byte>,
        fullUsername: String,
        traversal: GraphTraversalSource,
    ): String {
        val vertex = traversal.addV().next()
        vertex.apply {
            val dateOfDownload = Time().currentTimeToLong()

            listOntologyTags.forEach { tag ->
                property(ONTOLOGICAL_TAGS.list, tag)
            }

            property(MANDATE_LABEL.single, mandatoryLevel)
            property(NODE_CREATED.single, dateOfDownload)

            listNonHierarchicalLevels.forEach { level ->
                property(NON_HIERARCHICAL_PRIVACY_CATEGORIES.list, level)
            }

            propertiesHistory.forEach { propertyHistory ->
                val propertyName = GremlinPropertyName(name = propertyHistory.key)
                property(propertyName.single, propertyHistory.actualValue.value)
            }

            propertiesHistory.forEach { propertyHistory ->
                val propertyName = GremlinPropertyName(name = propertyHistory.key)
                propertyHistory.values.forEach { valueHistory ->
                    property(
                        propertyName.list, valueHistory.value,
                        LABEL_HISTORY_PROPERTY_LOAD_DATE.single, dateOfDownload,
                        LABEL_HISTORY_PROPERTY_COLLECTION_DATE.single, valueHistory.collectionDate,
                        LABEL_HISTORY_PROPERTY_DATE_OF_DOCUMENT_CREATION.single, valueHistory.documentCreationDate,
                        LABEL_USER_CHANGE_PROPERTY_NAME.single, fullUsername
                    )
                }
            }
        }

        return vertex.id().toString()
    }

Такие ошибки:

Caused by: com.datastax.oss.driver.api.core.AllNodesFailedException: All 1 node(s) tried for the query failed (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e): [com.datastax.oss.driver.api.core.NodeUnavailableException: No connection was available to Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e)]

Caused by: org.janusgraph.diskstorage.TemporaryBackendException: Could not successfully complete backend operation due to repeated temporary exceptions after PT1M40S


2024-03-25 10:00:52.171 [] [] [eventLoopGroupProxy-4-10] INFO  o.j.d.util.BackendOperation - Temporary exception during backend operation [CacheMutation]. Attempting backoff retry.
org.janusgraph.diskstorage.TemporaryBackendException: Temporary failure in storage backend
    at io.vavr.API$Match$Case0.apply(API.java:5135)
    at io.vavr.API$Match.of(API.java:5092)
    at org.janusgraph.diskstorage.cql.CQLKeyColumnValueStore.lambda$static$0(CQLKeyColumnValueStore.java:134)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.mutateMany(AbstractCQLMutateManyUnloggedFunction.java:64)
    at org.janusgraph.diskstorage.cql.CQLStoreManager.mutateMany(CQLStoreManager.java:304)
    at org.janusgraph.diskstorage.locking.consistentkey.ExpectedValueCheckingStoreManager.mutateMany(ExpectedValueCheckingStoreManager.java:84)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:99)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:66)
    at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:52)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.persist(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.flushInternal(CacheTransaction.java:147)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.mutate(CacheTransaction.java:91)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.KCVSCache.mutateEntries(KCVSCache.java:71)
    at org.janusgraph.diskstorage.BackendTransaction.mutateEdges(BackendTransaction.java:210)
    at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommitAddRelationMutations(StandardJanusGraph.java:788)
    at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommit(StandardJanusGraph.java:650)
    at org.janusgraph.graphdb.database.StandardJanusGraph.commit(StandardJanusGraph.java:899)
    at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.commit(StandardJanusGraphTx.java:1524)
    at project.janusGraph.TransactionJG.txTransactionSuspend(TransactionJG.kt:158)
    at project.janusGraph.TransactionJG.access$txTransactionSuspend(TransactionJG.kt:12)
    at project.janusGraph.TransactionJG$txTransactionSuspend$1.invokeSuspend(TransactionJG.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda$1$lambda$0(NettyApplicationEngine.kt:291)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.datastax.oss.driver.api.core.AllNodesFailedException: All 1 node(s) tried for the query failed (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e): [com.datastax.oss.driver.api.core.NodeUnavailableException: No connection was available to Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e)]
    at com.datastax.oss.driver.api.core.AllNodesFailedException.fromErrors(AllNodesFailedException.java:55)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.sendRequest(CqlRequestHandler.java:326)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.onThrottleReady(CqlRequestHandler.java:219)
    at com.datastax.oss.driver.internal.core.session.throttling.PassThroughRequestThrottler.register(PassThroughRequestThrottler.java:52)
Caused by: com.datastax.oss.driver.api.core.AllNodesFailedException: All 1 node(s) tried for the query failed (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e): [com.datastax.oss.driver.api.core.NodeUnavailableException: No connection was available to Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e)]

    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.<init>(CqlRequestHandler.java:184)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor.process(CqlRequestAsyncProcessor.java:44)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor.process(CqlRequestAsyncProcessor.java:29)
    at com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:237)
    at com.datastax.oss.driver.api.core.cql.AsyncCqlSession.executeAsync(AsyncCqlSession.java:42)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.execAsyncUnlogged(AbstractCQLMutateManyUnloggedFunction.java:71)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$null$0(CQLSimpleMutateManyUnloggedFunction.java:51)
    at io.vavr.Value.forEach(Value.java:340)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$null$1(CQLSimpleMutateManyUnloggedFunction.java:50)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$mutate$2(CQLSimpleMutateManyUnloggedFunction.java:49)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.mutate(CQLSimpleMutateManyUnloggedFunction.java:46)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.mutateMany(AbstractCQLMutateManyUnloggedFunction.java:61)
    ... 29 common frames omitted
    Suppressed: com.datastax.oss.driver.api.core.NodeUnavailableException: No connection was available to Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e)
        at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.sendRequest(CqlRequestHandler.java:318)
        ... 45 common frames omitted
2024-03-25 10:00:52.392 [] [] [eventLoopGroupProxy-4-10] INFO  o.j.d.util.BackendOperation - Temporary exception during backend operation [CacheMutation]. Attempting backoff retry.
org.janusgraph.diskstorage.TemporaryBackendException: Temporary failure in storage backend
    at io.vavr.API$Match$Case0.apply(API.java:5135)
    at io.vavr.API$Match.of(API.java:5092)
    at org.janusgraph.diskstorage.cql.CQLKeyColumnValueStore.lambda$static$0(CQLKeyColumnValueStore.java:134)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.mutateMany(AbstractCQLMutateManyUnloggedFunction.java:64)
    at org.janusgraph.diskstorage.cql.CQLStoreManager.mutateMany(CQLStoreManager.java:304)
    at org.janusgraph.diskstorage.locking.consistentkey.ExpectedValueCheckingStoreManager.mutateMany(ExpectedValueCheckingStoreManager.java:84)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:99)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:66)
    at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:52)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.persist(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.flushInternal(CacheTransaction.java:147)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.mutate(CacheTransaction.java:91)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.KCVSCache.mutateEntries(KCVSCache.java:71)
    at org.janusgraph.diskstorage.BackendTransaction.mutateEdges(BackendTransaction.java:210)
    at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommitAddRelationMutations(StandardJanusGraph.java:788)
    at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommit(StandardJanusGraph.java:650)
    at org.janusgraph.graphdb.database.StandardJanusGraph.commit(StandardJanusGraph.java:899)
    at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.commit(StandardJanusGraphTx.java:1524)
    at project.janusGraph.TransactionJG.txTransactionSuspend(TransactionJG.kt:158)
    at project.janusGraph.TransactionJG.access$txTransactionSuspend(TransactionJG.kt:12)
    at project.janusGraph.TransactionJG$txTransactionSuspend$1.invokeSuspend(TransactionJG.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda$1$lambda$0(NettyApplicationEngine.kt:291)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.datastax.oss.driver.api.core.AllNodesFailedException: All 1 node(s) tried for the query failed (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e): [com.datastax.oss.driver.api.core.NodeUnavailableException: No connection was available to Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e)]
    at com.datastax.oss.driver.api.core.AllNodesFailedException.fromErrors(AllNodesFailedException.java:55)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.sendRequest(CqlRequestHandler.java:326)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.onThrottleReady(CqlRequestHandler.java:219)
    at com.datastax.oss.driver.internal.core.session.throttling.PassThroughRequestThrottler.register(PassThroughRequestThrottler.java:52)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.<init>(CqlRequestHandler.java:184)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor.process(CqlRequestAsyncProcessor.java:44)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor.process(CqlRequestAsyncProcessor.java:29)
    at com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:237)
    at com.datastax.oss.driver.api.core.cql.AsyncCqlSession.executeAsync(AsyncCqlSession.java:42)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.execAsyncUnlogged(AbstractCQLMutateManyUnloggedFunction.java:71)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$null$0(CQLSimpleMutateManyUnloggedFunction.java:51)
    at io.vavr.Value.forEach(Value.java:340)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$null$1(CQLSimpleMutateManyUnloggedFunction.java:50)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$mutate$2(CQLSimpleMutateManyUnloggedFunction.java:49)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.mutate(CQLSimpleMutateManyUnloggedFunction.java:46)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.mutateMany(AbstractCQLMutateManyUnloggedFunction.java:61)
    ... 29 common frames omitted
    Suppressed: com.datastax.oss.driver.api.core.NodeUnavailableException: No connection was available to Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e)
        at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.sendRequest(CqlRequestHandler.java:318)
        ... 45 common frames omitted
2024-03-25 10:00:52.640 [] [] [eventLoopGroupProxy-4-10] INFO  o.j.d.util.BackendOperation - Temporary exception during backend operation [CacheMutation]. Attempting backoff retry.
org.janusgraph.diskstorage.TemporaryBackendException: Temporary failure in storage backend
    at io.vavr.API$Match$Case0.apply(API.java:5135)
    at io.vavr.API$Match.of(API.java:5092)
    at org.janusgraph.diskstorage.cql.CQLKeyColumnValueStore.lambda$static$0(CQLKeyColumnValueStore.java:134)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.mutateMany(AbstractCQLMutateManyUnloggedFunction.java:64)
    at org.janusgraph.diskstorage.cql.CQLStoreManager.mutateMany(CQLStoreManager.java:304)
    at org.janusgraph.diskstorage.locking.consistentkey.ExpectedValueCheckingStoreManager.mutateMany(ExpectedValueCheckingStoreManager.java:84)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:99)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:66)
    at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:52)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.persist(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.flushInternal(CacheTransaction.java:147)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.mutate(CacheTransaction.java:91)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.KCVSCache.mutateEntries(KCVSCache.java:71)
    at org.janusgraph.diskstorage.BackendTransaction.mutateEdges(BackendTransaction.java:210)
    at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommitAddRelationMutations(StandardJanusGraph.java:788)
    at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommit(StandardJanusGraph.java:650)
    at org.janusgraph.graphdb.database.StandardJanusGraph.commit(StandardJanusGraph.java:899)
    at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.commit(StandardJanusGraphTx.java:1524)
    at project.janusGraph.TransactionJG.txTransactionSuspend(TransactionJG.kt:158)
    at project.janusGraph.TransactionJG.access$txTransactionSuspend(TransactionJG.kt:12)
    at project.janusGraph.TransactionJG$txTransactionSuspend$1.invokeSuspend(TransactionJG.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda$1$lambda$0(NettyApplicationEngine.kt:291)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.datastax.oss.driver.api.core.AllNodesFailedException: All 1 node(s) tried for the query failed (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e): [com.datastax.oss.driver.api.core.NodeUnavailableException: No connection was available to Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e)]
    at com.datastax.oss.driver.api.core.AllNodesFailedException.fromErrors(AllNodesFailedException.java:55)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.sendRequest(CqlRequestHandler.java:326)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.onThrottleReady(CqlRequestHandler.java:219)
    at com.datastax.oss.driver.internal.core.session.throttling.PassThroughRequestThrottler.register(PassThroughRequestThrottler.java:52)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.<init>(CqlRequestHandler.java:184)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor.process(CqlRequestAsyncProcessor.java:44)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor.process(CqlRequestAsyncProcessor.java:29)
    at com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:237)
    at com.datastax.oss.driver.api.core.cql.AsyncCqlSession.executeAsync(AsyncCqlSession.java:42)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.execAsyncUnlogged(AbstractCQLMutateManyUnloggedFunction.java:71)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$null$0(CQLSimpleMutateManyUnloggedFunction.java:51)
    at io.vavr.Value.forEach(Value.java:340)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$null$1(CQLSimpleMutateManyUnloggedFunction.java:50)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$mutate$2(CQLSimpleMutateManyUnloggedFunction.java:49)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.mutate(CQLSimpleMutateManyUnloggedFunction.java:46)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.mutateMany(AbstractCQLMutateManyUnloggedFunction.java:61)
    ... 29 common frames omitted
    Suppressed: com.datastax.oss.driver.api.core.NodeUnavailableException: No connection was available to Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e)
        at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.sendRequest(CqlRequestHandler.java:318)
        ... 45 common frames omitted
2024-03-25 10:00:52.925 [] [] [eventLoopGroupProxy-4-10] INFO  o.j.d.util.BackendOperation - Temporary exception during backend operation [CacheMutation]. Attempting backoff retry.
org.janusgraph.diskstorage.TemporaryBackendException: Temporary failure in storage backend
    at io.vavr.API$Match$Case0.apply(API.java:5135)
    at io.vavr.API$Match.of(API.java:5092)
    at org.janusgraph.diskstorage.cql.CQLKeyColumnValueStore.lambda$static$0(CQLKeyColumnValueStore.java:134)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.mutateMany(AbstractCQLMutateManyUnloggedFunction.java:64)
    at org.janusgraph.diskstorage.cql.CQLStoreManager.mutateMany(CQLStoreManager.java:304)
    at org.janusgraph.diskstorage.locking.consistentkey.ExpectedValueCheckingStoreManager.mutateMany(ExpectedValueCheckingStoreManager.java:84)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:99)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:66)
    at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:52)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.persist(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.flushInternal(CacheTransaction.java:147)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.mutate(CacheTransaction.java:91)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.KCVSCache.mutateEntries(KCVSCache.java:71)
    at org.janusgraph.diskstorage.BackendTransaction.mutateEdges(BackendTransaction.java:210)
    at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommitAddRelationMutations(StandardJanusGraph.java:788)
    at org.janusgraph.graphdb.database.StandardJanusGraph.prepareCommit(StandardJanusGraph.java:650)
    at org.janusgraph.graphdb.database.StandardJanusGraph.commit(StandardJanusGraph.java:899)
    at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.commit(StandardJanusGraphTx.java:1524)
    at project.janusGraph.TransactionJG.txTransactionSuspend(TransactionJG.kt:158)
    at project.janusGraph.TransactionJG.access$txTransactionSuspend(TransactionJG.kt:12)
    at project.janusGraph.TransactionJG$txTransactionSuspend$1.invokeSuspend(TransactionJG.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda$1$lambda$0(NettyApplicationEngine.kt:291)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.datastax.oss.driver.api.core.AllNodesFailedException: All 1 node(s) tried for the query failed (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e): [com.datastax.oss.driver.api.core.NodeUnavailableException: No connection was available to Node(endPoint=/10.10.20.11:9042, hostId=ff175b9d-8085-4edd-a41c-809551c576e9, hashCode=4bd2521e)]
    at com.datastax.oss.driver.api.core.AllNodesFailedException.fromErrors(AllNodesFailedException.java:55)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.sendRequest(CqlRequestHandler.java:326)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.onThrottleReady(CqlRequestHandler.java:219)
    at com.datastax.oss.driver.internal.core.session.throttling.PassThroughRequestThrottler.register(PassThroughRequestThrottler.java:52)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.<init>(CqlRequestHandler.java:184)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor.process(CqlRequestAsyncProcessor.java:44)
    at com.datastax.oss.driver.internal.core.cql.CqlRequestAsyncProcessor.process(CqlRequestAsyncProcessor.java:29)
    at com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:237)
    at com.datastax.oss.driver.api.core.cql.AsyncCqlSession.executeAsync(AsyncCqlSession.java:42)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.execAsyncUnlogged(AbstractCQLMutateManyUnloggedFunction.java:71)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$null$0(CQLSimpleMutateManyUnloggedFunction.java:51)
    at io.vavr.Value.forEach(Value.java:340)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$null$1(CQLSimpleMutateManyUnloggedFunction.java:50)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.lambda$mutate$2(CQLSimpleMutateManyUnloggedFunction.java:49)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at org.janusgraph.diskstorage.cql.function.mutate.CQLSimpleMutateManyUnloggedFunction.mutate(CQLSimpleMutateManyUnloggedFunction.java:46)
    at org.janusgraph.diskstorage.cql.function.mutate.AbstractCQLMutateManyUnloggedFunction.mutateMany(AbstractCQLMutateManyUnloggedFunction.java:61)

Global DataStore instance. Kotlin

I want to store an access token in the DataStore when it is received. As such i created a class(DataStore) that handles the getting,saving and clearing. Since I want the same instance of DataStore to be available everywhere, I instantiated it in the MainApplication. My thinking was that all other classes will be able to access it with MyApplication.dataStore. I am however getting a memory leak warning from the IDE. What is the advised way to do this? thank you

class MyApplication : Application() {
    companion object {
        lateinit var dataStore: DataStore // memory leak warning here. StaticFieldLeak
    }
    private var tokenRetrievalScope: CoroutineScope? = null
    override fun onCreate() {
        super.onCreate()
        dataStore= DataStore(context = this)
        
    }
}

interface DataStoreManager {
    suspend fun getToken(): String
    suspend fun saveToken(token: String)
    suspend fun clearToken()  // Function to clear the token if needed
}

class DataStore(private val context: Context) : DataStoreManager {

    val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "settings")

    override suspend fun getToken(): String = withContext(Dispatchers.IO) {
        val preferences = context.dataStore.data.first() // Fetch Preferences
        preferences[PreferencesKeys.TOKEN] ?: "" // Access token with default
    }

❌
❌